Which DOM events can be bound to a DIV element?

后端 未结 3 1270
粉色の甜心
粉色の甜心 2021-01-03 23:16

As per question in the title...

相关标签:
3条回答
  • 2021-01-03 23:34

    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:

    mousedown, mouseup, mouseover, mousemove, mouseout, click, dblclick, keydown, keypress, keyup

    0 讨论(0)
  • 2021-01-03 23:41

    There are various events which can be performed on div tags such as

    ondrag,
    ondragcenter,
    ondragleave,
    ondrop,
    ondragover,
    ondragstart,
    ondragend,
    onscroll 
    
    0 讨论(0)
  • 2021-01-03 23:42

    event Attributes you can use:

    onclick, ondblclick, onmousedown, onmousemove, onmouseout, 
    onmouseover, onmouseup, onkeydown, onkeypress, onkeyup
    

    See more about the <div> tag here, and general DOM events here.

    0 讨论(0)
提交回复
热议问题