导航
×
   ❮   
HTML CSS JavaScript PHP Go Sass W3C Colors ECMS

JS 参考手册

JS 参考手册(字母排序)

JavaScript

JS Arrays JS Boolean JS Classes JS Dates JS Error JS Global JS Iterators JS JSON JS Maps JS Math JS Numbers JS Objects JS Operators JS Assignment JS Arithmetic JS Comparison JS Logical Operators JS Bitwise Operators JS Misc Operators JS Precedence JS Promises JS RegExp Patterns JS RegExp Reference JS Sets JS Statements JS Strings JS Typed Arrays JS Typed Reference

Window

Window Object Window Console Window History Window Location Window Navigator Window Screen

HTML DOM

HTML Documents HTML Elements HTML Attributes HTML Collection HTML NodeList HTML DOMTokenList 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 HTML Event Objects HTML Event Properties HTML Event Methods

Web APIs

API Canvas API Console API Fetch API Fullscreen API Geolocation API History API MediaQueryList API Storage API Validation API Web

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>

HTML 事件属性


HTML DOM 事件允许 JavaScript 在 HTML 文档中的元素上注册不同的事件处理程序。

事件通常与函数结合使用,并且函数不会在事件发生之前执行(例如,当用户单击按钮时)。

有关事件的教程,请阅读我们的JavaScript 事件教程

HTML DOM 事件属性

属性 描述 属于
altKey 返回鼠标事件触发时是否按下了"ALT"键 MouseEvent
altKey 返回触发按键事件时是否按下了"ALT"键 KeyboardEvent, TouchEvent
animationName 返回动画的名称 AnimationEvent
bubbles 返回特定事件是否为冒泡事件 Event
button 返回鼠标事件触发时按下的鼠标按键 MouseEvent
buttons 返回鼠标事件触发时按下的鼠标按键 MouseEvent
cancelable 返回是否可以阻止事件的默认操作 Event
charCode 已弃用(请避免使用)
请改用key 属性
KeyboardEvent
changeTouches 返回一个列表,其中包含在前一次触摸和本次触摸之间状态发生变化的所有触摸对象 TouchEvent
clientX 返回鼠标事件触发时鼠标指针相对于当前窗口的水平坐标 MouseEvent, TouchEvent
clientY 返回鼠标事件触发时鼠标指针相对于当前窗口的垂直坐标 MouseEvent, TouchEvent
clipboardData 返回一个包含剪贴板操作影响的数据的对象 ClipboardData
code 返回触发事件的按键代码 KeyboardEvent
composed 返回事件是否为组合事件 Event
ctrlKey 返回鼠标事件触发时是否按下了"Ctrl"键 MouseEvent
ctrlKey 返回按键事件触发时是否按下了"Ctrl"键 KeyboardEvent, TouchEvent
currentTarget 返回触发事件的元素 Event
data 返回插入的字符 InputEvent
dataTransfer 返回包含正在拖放或插入/删除的数据的对象 DragEvent, InputEvent
defaultPrevented 返回是否为该事件调用了 preventDefault() 方法 Event
deltaX 返回鼠标滚轮水平滚动的量(x 轴) WheelEvent
deltaY 返回鼠标滚轮垂直滚动的量(y 轴) WheelEvent
deltaZ 返回鼠标滚轮 z 轴滚动的量 WheelEvent
deltaMode 返回一个数字,表示增量值的计量单位(像素、行或页) WheelEvent
detail 返回一个数字,表示鼠标被点击的次数 UiEvent
elapsedTime 返回动画运行的秒数 AnimationEvent
elapsedTime 返回过渡效果已运行的秒数
eventPhase 返回当前正在评估的事件流阶段 Event
getModifierState() 返回一个包含受插入/删除操作影响的目标范围的数组 MouseEvent
inputType 返回更改类型(即"插入"或"删除") InputEvent
isComposing 返回事件的状态是否为"正在组成" InputEvent, KeyboardEvent
isTrusted 返回事件是否可信 Event
key 返回事件所代表的键的键值 KeyboardEvent
key 返回已更改存储项的键 StorageEvent
keyCode 已弃用(请避免使用)
请改用key 属性
KeyboardEvent
location 返回键盘或设备上某个键的位置 KeyboardEvent
lengthComputable 返回进度长度是否可以计算 ProgressEvent
loaded 返回已加载的工作量 ProgressEvent
metaKey 返回事件触发时是否按下了"META"键 MouseEvent
metaKey 返回按键事件触发时是否按下了"meta"键 KeyboardEvent, TouchEvent
MovementX 返回鼠标指针相对于上次 mousemove 事件位置的水平坐标 MouseEvent
MovementY 返回鼠标指针相对于上次 mousemove 事件位置的垂直坐标 MouseEvent
newValue 返回已更改存储项的新值 StorageEvent
newURL 返回哈希值更改后的文档 URL HasChangeEvent
offsetX 返回鼠标指针相对于目标元素边缘位置的水平坐标 MouseEvent
offsetY 返回鼠标指针相对于目标元素边缘位置的垂直坐标 MouseEvent
oldValue 返回已更改存储项的旧值 StorageEvent
oldURL 返回哈希值更改之前的文档 URL HasChangeEvent
onemptied 当发生意外情况,媒体文件突然无法访问时(例如意外断开连接)
pageX 返回鼠标事件触发时鼠标指针相对于文档的水平坐标 MouseEvent
pageY 返回鼠标事件触发时鼠标指针相对于文档的垂直坐标 MouseEvent
persisted 返回网页是否已被浏览器缓存 PageTransitionEvent
propertyName 返回与动画或过渡效果关联的 CSS 属性名称 AnimationEvent, TransitionEvent
pseudoElement 返回动画或过渡效果的伪元素名称 AnimationEvent,TransitionEvent
region MouseEvent
relatedTarget 返回与触发鼠标事件的元素相关的元素 MouseEvent
relatedTarget 返回与触发事件的元素相关的元素 FocusEvent
repeat 返回某个键是否被反复按下 KeyboardEvent
screenX 返回事件触发时鼠标指针相对于屏幕的水平坐标 MouseEvent
screenY 返回事件触发时鼠标指针相对于屏幕的垂直坐标 MouseEvent
shiftKey 返回事件触发时是否按下了"SHIFT"键 MouseEvent
shiftKey 返回触发按键事件时是否按下了"SHIFT"键 KeyboardEvent, TouchEvent
state 返回包含历史记录条目副本的对象 PopStateEvent
storageArea 返回表示受影响存储对象的对象 StorageEvent
target 返回触发事件的元素 Event
targetTouches 返回与表面接触且 touchstart 事件发生在与当前目标元素相同目标元素上的所有触摸对象的列表 触摸事件
timeStamp 返回事件创建的时间(以毫秒为单位,相对于 Unix 纪元)。 Event
total 返回将要加载的总工作量 ProgressEvent
touches 返回当前与表面接触的所有触摸对象的列表 TouchEvent
transitionend CSS 过渡效果已完成 TransitionEvent
type 返回事件名称 Event
url 返回已更改项的文档 URL StorageEvent
which 已弃用(请避免使用)
请改用 button 属性
MouseEvent
which 已弃用(请避免使用)
请改用 key 属性
KeyboardEvent
view 返回事件发生的窗口对象的引用 UiEvent
x clientX 的别名 MouseEvent
y clientY 的别名 MouseEvent

Copyright ©2020-2026 freew3c.com All Rights Reserved 提供的内容仅用于学习和测试,不保证内容的正确性。