📅  最后修改于: 2020-10-25 04:38:30             🧑  作者: Mango
HTML或DOM事件在JavaScript代码中被广泛使用。 JavaScript代码通过HTML / DOM事件执行。因此,在学习JavaScript之前,让我们对事件有所了解。
Events | Description |
---|---|
onclick | occurs when element is clicked. |
ondblclick | occurs when element is double-clicked. |
onfocus | occurs when an element gets focus such as button, input, textarea etc. |
onblur | occurs when form looses the focus from an element. |
onsubmit | occurs when form is submitted. |
onmouseover | occurs when mouse is moved over an element. |
onmouseout | occurs when mouse is moved out from an element (after moved over). |
onmousedown | occurs when mouse button is pressed over an element. |
onmouseup | occurs when mouse is released from an element (after mouse is pressed). |
onload | occurs when document, object or frameset is loaded. |
onunload | occurs when body or frameset is unloaded. |
onscroll | occurs when document is scrolled. |
onresized | occurs when document is resized. |
onreset | occurs when form is reset. |
onkeydown | occurs when key is being pressed. |
onkeypress | occurs when user presses the key. |
onkeyup | occurs when key is released. |