javascript - 所有具有受支持元素的 DOM 事件?

标签 javascript dom-events

是否有所有 JavaScript 事件(onClick()onMouseDown() 等等)的列表以及关于哪些元素有效的信息?

(例如,onBlur 事件在除 IE 以外的大多数浏览器中对非表单事件无效。)

我知道很多事情都是“常识”(你如何focus()在一个段落上),但我发现在开发中仅依靠常识很少得到你远。 :)

最佳答案

来源本身:http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html

查看事件下,“目标”描述资格:http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-type-load

除此之外的任何内容均未在规范中定义,因此不被视为无效。就像你说的,很多都是常识,并留给你的实现。

虽然有一些很好的花絮可以引发进一步的研究:

A host language may define specific elements which may or may not receive focus, the conditions user which an element may receive focus, the means by which focus may be changed, and the order in which the focus changes. For example, in some cases an element might be given focus by moving a pointer over it, while other circumstances might require a mouse click; some elements might not be focusable at all, and some might be focusable only by special means (clicking on the element), but not by tabbing to it. Documents may contain multiple focus rings. Other specifications may define a more complex focus model than is described in this specification, including allowing multiple elements to have the current focus.

关于javascript - 所有具有受支持元素的 DOM 事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6755230/

相关文章:

javascript - 使用 javascript 使元素改变它自己的内容

javascript - 将 javascript 日期转换为 json 日期格式

javascript - 为什么点击事件在两次点击后起作用 VANILLA

javascript - onkeyup 函数 JavaScript

javascript - 如何在 Javascript 中将光标设置为输入框?

javascript - Angular js 依赖注入(inject)不起作用

javascript - 具有多个作用域的 JQuery UI 可拖放?

javascript - 无法进入下一个输入字段 - jQuery

javascript - Twilio IP 消息传递,如何取消订阅 channel

javascript - 迭代 JavaScript 对象以绑定(bind)键