Html 哪些 DOM 事件可以绑定到 DIV 元素?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7284379/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Which DOM events can be bound to a DIV element?
提问by RedDragon
As per question in the title...
根据标题中的问题...
回答by Richard H
There's a complete list of DOM events here, which includes browser-specific and touch-interface events as well. All the Mouse and Keyboard events can be attached to a div, which are:
有DOM事件的完整列表在这里,其中包括浏览器特定的和触摸界面事件也是如此。所有的鼠标和键盘事件都可以附加到一个 div 上,它们是:
mousedown, mouseup, mouseover, mousemove, mouseout, click, dblclick, keydown, keypress, keyup
mousedown, mouseup, mouseover, mousemove, mouseout, click, dblclick, keydown, keypress, keyup
回答by GSGupta
There are various events which can be performed on div
tags such as
可以在div
标签上执行各种事件,例如
ondrag,
ondragcenter,
ondragleave,
ondrop,
ondragover,
ondragstart,
ondragend,
onscroll