帅码编程
教程
HTML
CSS
JAVASCRIPT
JQUERY
AI
PHP
SQL
EXCEL
LINUX
C#
C++
C
PYTHON
JAVA
教程库
参考手册
技术文章
测验
练习
HOWTO
FAQ
JS
参考手册
JS 参考手册(类别排序)
JS 参考手册(字母排序)
JavaScript
JS Arrays
Array[ ]
Array( )
at()
concat()
constructor
copyWithin()
entries()
every()
fill()
filter()
find()
findIndex()
findLast()
findLastIndex()
flat()
flatMap()
forEach()
from()
includes()
indexOf()
isArray()
join()
keys()
lastIndexOf()
length
map()
of()
pop()
prototype
push()
reduce()
reduceRight()
rest (...)
reverse()
shift()
slice()
some()
sort()
splice()
spread (...)
toReversed()
toSorted()
toSpliced()
toString()
unshift()
values()
valueOf()
with()
JS Boolean
Boolean()
new Boolean()
constructor
prototype
toString()
valueOf()
JS Classes
constructor()
extends
static
super
JS Dates
new Date()
constructor
getDate()
getDay()
getFullYear()
getHours()
getMilliseconds()
getMinutes()
getMonth()
getSeconds()
getTime()
getTimezoneOffset()
getUTCDate()
getUTCDay()
getUTCFullYear()
getUTCHours()
getUTCMilliseconds()
getUTCMinutes()
getUTCMonth()
getUTCSeconds()
now()
parse()
prototype
setDate()
setFullYear()
setHours()
setMilliseconds()
setMinutes()
setMonth()
setSeconds()
setTime()
setUTCDate()
setUTCFullYear()
setUTCHours()
setUTCMilliseconds()
setUTCMinutes()
setUTCMonth()
setUTCSeconds()
toDateString()
toISOString()
toJSON()
toLocaleDateString()
toLocaleTimeString()
toLocaleString()
toString()
toTimeString()
toUTCString()
UTC()
valueOf()
JS Error
isError()
name
message
JS Global
decodeURI()
decodeURIComponent()
encodeURI()
encodeURIComponent()
escape()
eval()
Infinity
isFinite()
isNaN()
NaN
Number()
parseFloat()
parseInt()
String()
undefined
unescape()
JS Iterators
drop()
every()
filter()
find()
flatMap()
forEach()
map()
reduce()
some()
take()
JS JSON
parse()
stringify()
JS Maps
new Map
clear()
delete()
entries()
forEach()
get()
groupBy()
has()
keys()
set()
size
values()
JS Math
abs()
acos()
acosh()
asin()
asinh()
atan()
atan2()
atanh()
cbrt()
ceil()
clz32()
cos()
cosh()
E
exp()
expm1()
f16round()
floor()
fround()
LN2
LN10
log()
log10()
log1p()
log2()
LOG2E
LOG10E
max()
min()
PI
pow()
random()
round()
sign()
sin()
sinh()
sqrt()
SQRT1_2
SQRT2
tan()
tanh()
trunc()
JS Numbers
constructor
EPSILON
isFinite()
isInteger()
isNaN()
isSafeInteger()
MAX_SAFE_INTEGER
MIN_SAFE_INTEGER
MAX_VALUE
MIN_VALUE
NaN
NEGATIVE_INFINITY
POSITIVE_INFINITY
parseFloat()
parseInt()
prototype
toExponential()
toFixed()
toLocaleString()
toPrecision()
toString()
valueOf()
JS Objects
assign()
constructor
create()
defineProperties()
defineProperty()
delete
entries()
freeze()
fromEntries()
getOwnPropertyDescriptor()
getOwnPropertyDescriptors()
getOwnPropertyNames()
groupBy()
isExtensible()
isFrozen()
isSealed()
keys()
preventExtensions()
prototype
seal()
toString()
valueOf()
values()
JS Operators
JS Assignment
Assign Simple
Assign Add
Assign Subtract
Assign Multiply
Assign Divide
Assign Remainder
Assign Colon
Assign AND
Assign OR
Assign Nullish
JS Arithmetic
Addition
Subtraction
Multiplication
Division
Exponentiation
Remainder
Increment
Decrement
Concatenation
Unary Plus
Unary Negation
JS Comparison
Equal
Strict Equal
Not Equal
Strict Not Equal
Greater Than
Less Than
Greater Equal
Less Equal
JS Logical Operators
Logical AND
Logical OR
Logical NOT
Logical Nullish
JS Bitwise Operators
Bitwise AND
Bitwise OR
Bitwise NOT
Bitwise XOR
Bitwise Left
Bitwise Right
Bitwise Signed
JS Misc Operators
:
?.
...
() ? x : y
=>
delete
in
instanceof
typeof
void
JS Precedence
JS Promises
all()
allSettled()
any()
catch()
finally()
race()
reject()
resolve()
then()
JS RegExp Patterns
/d
/g
/i
/m
/s
/u
/v
/y
[a]
[^a]
[abc]
[^abc]
[A-Z]
[^A-Z]
[0-9]
[^0-9]
a|b
.
\w
\W
\d
\D
\s
\S
[\b]
\0
\n
\f
\r
\t
\v
\p
\P
\ddd
\xhh
\uhhhh
^
$
\b
\B
x(?=y)
x(?!y)
(?<=y)x
(?<!y)x
(x)
(?<name>x)
(?flags:x)
+
*
?
{n}
{n,m}
{n,}
JS RegExp Reference
compile()
constructor
dotAll
escape()
exec()
flags
global
hasIndices
ignoreCase
lastIndex
multiline
source
sticky
test()
toString()
unicode
unicodeSets
JS Sets
new Set
add()
clear()
delete()
difference()
entries()
forEach()
has()
intersection()
isDisjointFrom()
isSubsetOf()
isSupersetOf()
keys()
size
symmetricDifference()
union()
values()
JS Statements
break
class
const
continue
debugger
do...while
for
for...in
for...of
function
if...else
let
return
switch
throw
try...catch
var
while
JS Strings
at()
charAt()
charCodeAt()
codePointAt()
concat()
constructor
endsWith()
fromCharCode()
includes()
indexOf()
isWellFormed()
lastIndexOf()
length
localeCompare()
match()
matchAll()
padEnd()
padStart()
prototype
repeat()
replace()
replaceAll()
search()
slice()
split()
startsWith()
substr()
substring()
toLocaleLowerCase()
toLocaleUpperCase()
toLowerCase()
toString()
toUpperCase()
toWellFormed()
trim()
trimEnd()
trimStart()
valueOf()
JS Typed Arrays
Int8Array
Uint8Array
Uint8ClampedArray
Int16Array
Uint16Array
Int32Array
Uint32Array
BigInt64Array
BigUint64Array
Float16Array
Float32Array
Float64Array
JS Typed Reference
at()
byteLength
byteOffset
bytesPerElement
copyWithin()
entries()
every()
fill()
filter()
find()
findIndex()
findLast()
findLastIndex()
forEach()
from()
includes()
indexOf()
join()
keys()
lastIndexOf()
length
map()
name
of()
reduce()
reduceRight()
reverse()
set()
slice()
some()
sort()
subarray()
toLocaleString()
toReversed()
toSorted()
toString()
values()
with()
Window
Window Object
addeventlistener()
alert()
atob()
blur()
btoa()
clearInterval()
clearTimeout()
close()
closed
confirm()
console
defaultStatus
document
focus()
frameElement
frames
history
getComputedStyle()
innerHeight
innerWidth
length
localStorage
location
matchMedia()
moveBy()
moveTo()
name
navigator
open()
opener
outerHeight
outerWidth
pageXOffset
pageYOffset
parent
print()
prompt()
removeEventlistener()
resizeBy()
resizeTo()
screen
screenLeft
screenTop
screenX
screenY
scrollBy()
scrollTo()
scrollX
scrollY
sessionStorage
self
setInterval()
setTimeout()
status
stop()
top
Window Console
assert()
clear()
count()
error()
group()
groupCollapsed()
groupEnd()
info()
log()
table()
time()
timeEnd()
trace()
warn()
Window History
back()
forward()
go()
length
Window Location
assign()
hash
host
hostname
href
origin
pathname
port
protocol
reload()
replace()
search
Window Navigator
appCodeName
appName
appVersion
cookieEnabled
geolocation
javaEnabled()
language
onLine
platform
product
taintEnabled()
userAgent
Window Screen
availHeight
availWidth
colorDepth
height
pixelDepth
width
HTML DOM
HTML Documents
activeElement
addEventListener()
adoptNode()
anchors
applets
baseURI
body
charset
characterSet
close()
cookie
createAttribute()
createComment()
createDocumentFragment()
createElement()
createEvent()
createTextNode()
defaultView
designMode
doctype
documentElement
documentMode
documentURI
domain
domConfig
embeds
execCommand()
forms
getElementById()
getElementsByClassName()
getElementsByName()
getElementsByTagName()
hasFocus()
head
images
implementation
importNode()
inputEncoding
lastModified
links
normalize()
normalizeDocument()
open()
querySelector()
querySelectorAll()
readyState
referrer
removeEventListener()
renameNode()
scripts
strictErrorChecking
title
URL
write()
writeln()
HTML Elements
accessKey
addEventListener()
after()
append()
appendChild()
attributes
before()
blur()
childElementCount
childNodes
children
classList
className
click()
clientHeight
clientLeft
clientTop
clientWidth
cloneNode()
closest()
compareDocumentPosition()
contains()
contentEditable
dir
firstChild
firstElementChild
focus()
getAttribute()
getAttributeNode()
getBoundingClientRect()
getElementsByClassName()
getElementsByTagName()
hasAttribute()
hasAttributes()
hasChildNodes()
id
innerHTML
innerText
insertAdjacentElement()
insertAdjacentHTML()
insertAdjacentText()
insertBefore()
isContentEditable
isDefaultNamespace()
isEqualNode()
isSameNode()
isSupported()
lang
lastChild
lastElementChild
matches()
namespaceURI
nextSibling
nextElementSibling
nodeName
nodeType
nodeValue
normalize()
offsetHeight
offsetWidth
offsetLeft
offsetParent
offsetTop
outerHTML
outerText
ownerDocument
parentNode
parentElement
previousSibling
previousElementSibling
querySelector()
querySelectorAll()
remove()
removeAttribute()
removeAttributeNode()
removeChild()
removeEventListener()
replaceChild()
scrollHeight
scrollIntoView()
scrollLeft
scrollTop
scrollWidth
setAttribute()
setAttributeNode()
style
tabIndex
tagName
textContent
title
HTML Attributes
getNamedItem()
isId
item()
length
name
removeNamedItem()
setNamedItem()
specified
value
HTML Collection
item()
length
namedItem()
HTML NodeList
entries()
forEach()
item()
keys()
length
values()
HTML DOMTokenList
add()
contains()
entries()
forEach()
item()
keys()
length
remove()
replace()
supports()
toggle()
value
values()
HTML Styles
alignContent
alignItems
alignSelf
animation
animationDelay
animationDirection
animationDuration
animationFillMode
animationIterationCount
animationName
animationTimingFunction
animationPlayState
background
backgroundAttachment
backgroundClip
backgroundColor
backgroundImage
backgroundOrigin
backgroundPosition
backgroundRepeat
backgroundSize
backfaceVisibility
border
borderBottom
borderBottomColor
borderBottomLeftRadius
borderBottomRightRadius
borderBottomStyle
borderBottomWidth
borderCollapse
borderColor
borderImage
borderImageOutset
borderImageRepeat
borderImageSlice
borderImageSource
borderImageWidth
borderLeft
borderLeftColor
borderLeftStyle
borderLeftWidth
borderRadius
borderRight
borderRightColor
borderRightStyle
borderRightWidth
borderSpacing
borderStyle
borderTop
borderTopColor
borderTopLeftRadius
borderTopRightRadius
borderTopStyle
borderTopWidth
borderWidth
bottom
boxShadow
boxSizing
captionSide
caretColor
clear
clip
color
columnCount
columnFill
columnGap
columnRule
columnRuleColor
columnRuleStyle
columnRuleWidth
columns
columnSpan
columnWidth
counterIncrement
counterReset
cssFloat
cursor
direction
display
emptyCells
filter
flex
flexBasis
flexDirection
flexFlow
flexGrow
flexShrink
flexWrap
font
fontFamily
fontSize
fontStyle
fontVariant
fontWeight
fontSizeAdjust
height
isolation
justifyContent
left
letterSpacing
lineHeight
listStyle
listStyleImage
listStylePosition
listStyleType
margin
marginBottom
marginLeft
marginRight
marginTop
maxHeight
maxWidth
minHeight
minWidth
objectFit
objectPosition
opacity
order
orphans
outline
outlineColor
outlineOffset
outlineStyle
outlineWidth
overflow
overflowX
overflowY
padding
paddingBottom
paddingLeft
paddingRight
paddingTop
pageBreakAfter
pageBreakBefore
pageBreakInside
perspective
perspectiveOrigin
position
quotes
resize
right
scrollBehavior
tableLayout
tabSize
textAlign
textAlignLast
textDecoration
textDecorationColor
textDecorationLine
textDecorationStyle
textIndent
textOverflow
textShadow
textTransform
top
transform
transformOrigin
transformStyle
transition
transitionProperty
transitionDuration
transitionTimingFunction
transitionDelay
unicodeBidi
userSelect
verticalAlign
visibility
width
wordBreak
wordSpacing
wordWrap
widows
zIndex
HTML Events
HTML Events
abort
afterprint
animationend
animationiteration
animationstart
beforeprint
beforeunload
blur
canplay
canplaythrough
change
click
contextmenu
copy
cut
dblclick
drag
dragend
dragenter
dragleave
dragover
dragstart
drop
durationchange
ended
error
focus
focusin
focusout
fullscreenchange
fullscreenerror
hashchange
input
invalid
keydown
keypress
keyup
load
loadeddata
loadedmetadata
loadstart
message
mousedown
mouseenter
mouseleave
mousemove
mouseover
mouseout
mouseup
offline
online
open
pagehide
pageshow
paste
pause
play
playing
progress
ratechange
resize
reset
scroll
search
seeked
seeking
select
show
stalled
submit
suspend
timeupdate
toggle
touchcancel
touchend
touchmove
touchstart
transitionend
unload
volumechange
waiting
wheel
HTML Event Objects
Animation Events
Clipboard Events
Drag Events
Events
Focus Events
HashChange Events
Input Events
Keyboard Events
Mouse Events
PageTransition Events
PopState Events
Progress Events
Storage Events
Touch Events
Transition Events
Ui Events
Wheel Events
HTML Event Properties
altKey (Mouse)
altKey (Key)
animationName
bubbles
button
buttons
cancelable
charCode
clientX
clientY
code
ctrlKey (Mouse)
ctrlKey (Key)
currentTarget
data
defaultPrevented
deltaX
deltaY
deltaZ
deltaMode
detail
elapsedTime
elapsedTime
eventPhase
inputType
isTrusted
key
keyCode
location
metaKey (Mouse)
metaKey (Key)
newURL
oldURL
offsetX
offsetY
pageX
pageY
persisted
propertyName
relatedTarget
relatedTarget
screenX
screenY
shiftKey (Mouse)
shiftKey (Key)
target
targetTouches
timeStamp
touches
type
which (Mouse)
which (Key)
view
HTML Event Methods
getModifierState()
preventDefault()
stopImmidiatePropagation()
stopPropagation()
Web APIs
API Canvas
API Console
API Fetch
API Fullscreen
exitFullscreen()
fullscreenElement
fullscreenEnabled()
requestFullscreen()
API Geolocation
coordinates
getCurrentPosition()
position
API History
API MediaQueryList
API Storage
clear()
getItem()
key()
length
removeItem()
setItem()
API Validation
API Web
crypto.getRandomNumber()
HTML 对象
<a>
<abbr>
<address>
<area>
<article>
<aside>
<audio>
<b>
<base>
<bdo>
<blockquote>
<body>
<br>
<button>
<canvas>
<caption>
<cite>
<code>
<col>
<colgroup>
<datalist>
<dd>
<del>
<details>
<dfn>
<dialog>
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
<figcaption>
<figure>
<footer>
<form>
<head>
<header>
<h1> - <h6>
<hr>
<html>
<i>
<iframe>
<img>
<ins>
<input> button
<input> checkbox
<input> color
<input> date
<input> datetime
<input> datetime-local
<input> email
<input> file
<input> hidden
<input> image
<input> month
<input> number
<input> password
<input> radio
<input> range
<input> reset
<input> search
<input> submit
<input> text
<input> time
<input> url
<input> week
<kbd>
<label>
<legend>
<li>
<link>
<map>
<mark>
<menu>
<menuitem>
<meta>
<meter>
<nav>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<pre>
<progress>
<q>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strong>
<style>
<sub>
<summary>
<sup>
<table>
<tbody>
<td>
<tfoot>
<th>
<thead>
<tr>
<textarea>
<time>
<title>
<track>
<u>
<ul>
<var>
<video>
其他参考手册
CSSStyleDeclaration
cssText
getPropertyPriority()
getPropertyValue()
item()
length
parentRule
removeProperty()
setProperty()
JS 类型转换
HTML DOM Document charset 属性
❮ HTML DOM body 属性
❮ Document 对象参考
HTML DOM characterSet 属性 ❯
示例
获取文档的字符编码:
encoding = document.charset;
亲自试一试 »
描述
charset 属性已弃用,请勿使用。
charset 属性在未来的浏览器中可能无法正常工作。
替代方案:
文档字符集属性
另请参阅:
HTML 字符集参考
语法
document.charset
返回值
类型
描述
字符串
文档的字符编码。
❮ HTML DOM body 属性
❮ Document 对象参考
HTML DOM characterSet 属性 ❯
读后有收获请站长喝杯咖啡
关注公众号随时查看编程教程
视频教程更易懂,点点关注不迷路
关于我们
|
隐私条款
|
学习路线
返回顶部