trainingtrains Logo

91-9990449935

 0120-4256464

HTML/DOM events for JavaScript

HTML or DOM events are widely used in JavaScript code. JavaScript code is executed with HTML/DOM events. So before learning JavaScript, let’s have some idea about events.

EventsDescription
onclickoccurs when element is clicked.
ondblclickoccurs when element is double-clicked.
onfocusoccurs when an element gets focus such as button, input, textarea etc.
onbluroccurs when form looses the focus from an element.
onsubmitoccurs when form is submitted.
onmouseoveroccurs when mouse is moved over an element.
onmouseoutoccurs when mouse is moved out from an element (after moved over).
onmousedownoccurs when mouse button is pressed over an element.
onmouseupoccurs when mouse is released from an element (after mouse is pressed).
onloadoccurs when document, object or frameset is loaded.
onunloadoccurs when body or frameset is unloaded.
onscrolloccurs when document is scrolled.
onresizedoccurs when document is resized.
onresetoccurs when form is reset.
onkeydownoccurs when key is being pressed.
onkeypressoccurs when user presses the key.
onkeyupoccurs when key is released.