码农教程 - 一技在手,衣食无忧!
首页
HTML/CSS
HTML
CSS
W3.CSS
Bootstrap
SASS
Bootstrap4
Bootstrap5
JavaScript
JavaScript
React
jQuery
Nodejs
VUE
TypeScript
Angular
服务端
JAVA
PHP
C
C++
GO
Django
数据库
SQL
MYSQL
PostgreSql
MongoDb
数据分析
PYTHON
R
移动端
Kotlin
XML 教程
XML
ASP.NET
C#
ASP
开发工具
GIT
网站建设
How To
AWS
网络安全
AI
机器学习
生成式 AI
数据科学
目录
JS 参考
按字母顺序的 JS
JavaScript
JS 数组
JS 数组
at()
concat()
constructor
copyWithin()
entries()
every()
fill()
filter()
find()
findIndex()
flat()
flatMap()
forEach()
from()
includes()
indexOf()
isArray()
join()
keys()
lastIndexOf()
length
map()
pop()
prototype
push()
reduce()
reduceRight()
reverse()
shift()
slice()
some()
sort()
splice()
toString()
unshift()
valueOf()
JS 布尔
JS 布尔
constructor
prototype
toString()
valueOf()
JS 类
JS 类
constructor()
extends
static
super
JS 日期
JS 日期
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 错误
JS 错误
name
message
JS 全局
JS 全局
decodeURI()
decodeURIComponent()
encodeURI()
encodeURIComponent()
escape()
eval()
Infinity
isFinite()
isNaN()
NaN
Number()
parseFloat()
parseInt()
String()
undefined
unescape()
JS JSON
JS JSON
parse()
stringify()
JS 数学
JS 数学
abs()
acos()
acosh()
asin()
asinh()
atan()
atan2()
atanh()
cbrt()
ceil()
clz32()
cos()
cosh()
E
exp()
expm1()
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 数字
JS 数字
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 对象
JS 对象
constructor
keys()
prototype
toString()
valueOf()
JS 运算符
JS 优先级
JS 正则表达式
JS 正则表达式
g
i
m
[abc]
[^abc]
[0-9]
[^0-9]
(x|y)
.
\w
\W
\d
\D
\s
\S
\b
\B
\0
\n
\f
\r
\t
\v
\xxx
\xdd
\uxxxx
+
*
?
{X}
{X,Y}
{X,}
$
^
?=
?!
constructor
global
ignoreCase
lastIndex
multiline
source
compile()
exec()
test()
toString()
JS 声明
JS 声明
break
class
const
continue
debugger
do...while
for
for...in
for...of
function
if...else
let
return
switch
throw
try...catch
var
while
JS 字符串
JS 字符串
at()
charAt()
charCodeAt()
codePointAt()
concat()
constructor
endsWith()
fromCharCode()
includes()
indexOf()
lastIndexOf()
length
localeCompare()
match()
padEnd()
padStart()
prototype
repeat()
replace()
replaceAll()
search()
slice()
split()
startsWith()
substr()
substring()
toLocaleLowerCase()
toLocaleUpperCase()
toLowerCase()
toString()
toUpperCase()
trim()
trimEnd()
trimStart()
valueOf()
JS 类型数组
窗口
窗口对象
窗口对象
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
窗口控制台
窗口控制台
assert()
clear()
count()
error()
group()
groupCollapsed()
groupEnd()
info()
log()
table()
time()
timeEnd()
trace()
warn()
窗口历史
窗口历史
back()
forward()
go()
length
窗口位置
窗口位置
assign()
hash
host
hostname
href
origin
pathname
port
protocol
reload()
replace()
search
窗口导航器
窗口导航器
appCodeName
appName
appVersion
cookieEnabled
geolocation
javaEnabled()
language
onLine
platform
product
taintEnabled()
userAgent
窗口屏幕
窗口屏幕
availHeight
availWidth
colorDepth
height
pixelDepth
width
HTML DOM
HTML 文档
HTML 文档
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 元素
HTML 元素
accessKey
addEventListener()
appendChild()
attributes
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 属性
HTML 属性
getNamedItem()
isId
item()
length
name
removeNamedItem()
setNamedItem()
specified
value
HTML 集合
HTML 集合
item()
length
namedItem()
HTML 节点列表
HTML 节点列表
entries()
forEach()
item()
keys()
length
values()
HTML DOMTokenList
HTML DOMTokenList
add()
contains()
entries()
forEach()
item()
keys()
length
remove()
replace()
supports()
toggle()
value
values()
HTML 样式
HTML 样式
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 事件
HTML 事件
HTML 事件
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 事件对象
HTML 事件对象
动画事件
剪贴板事件
拖拽事件
事件
焦点事件
哈希变化事件
输入事件
键盘事件
鼠标事件
页面转换事件
弹出状态事件
进度事件
存储事件
触摸事件
过渡事件
UI 事件
滚轮事件
HTML 事件属性
HTML 事件属性
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 事件方法
HTML 事件方法
getModifierState()
preventDefault()
stopImmidiatePropagation()
stopPropagation()
Web APIs
API 画布
API 控制台
API 获取
API 全屏
API 全屏
exitFullscreen()
fullscreenElement
fullscreenEnabled()
requestFullscreen()
API 地理位置
API 地理位置
coordinates
getCurrentPosition()
position
API 历史
API 媒体查询列表
API 存储
API 存储
clear()
getItem()
key()
length
removeItem()
setItem()
API 验证
API Web
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>
<sub>
<summary>
<sup>
<table>
<tbody>
<td>
<tfoot>
<th>
<thead>
<tr>
<textarea>
<time>
<title>
<track>
<u>
<ul>
<var>
<video>
其他参考
CSS 样式声明
CSS 样式声明
cssText
getPropertyPriority()
getPropertyValue()
item()
length
parentRule
removeProperty()
setProperty()
JS 转换
KeyboardEvent 键码
❮
上一节
事件属性
下一节
❯
示例
获取按下的键盘按键的值:
let value = event.keyCode;
亲自试一试 »
描述
警告 !
keyCode 属性已弃用。
使用
关键属性
反而。
也可以看看:
键盘事件键属性
语法
event.keyCode
技术细节
返回值:
一个号码
字符代码
DOM 版本:
DOM 级别 2
键盘事件
。
❮
上一节
事件属性
下一节
❯
纠错反馈
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!
标注
直接在页面拖动鼠标来标注反馈区域!
下一步
反馈内容
联系方式(邮箱)
返回
提交