Pages

Different type of events Available in Javscript

Events associated with Mouse: onmousemove: If the user moves a button, then the events associated with onmousemove fire. onclick: onclick events fire when the mouse button clicks. ondblclick: The event ondblclick fires when the mouse button is double clicked. There are also some events associated with the mouse pointer position such as: onmouseout: onmouseout event fires if the mouse pointer position is out of focus from the element. onmouseover: onmouseover event fires if the mouse pointer position is in focus of the element position. The above are some of the various mouse events available in JavaScript. Events associated with Keyboard: onkeydown onkeyup onkeypress onkeydown: onkeydown event fires when key is pressed. onkeyup: onkeyup event fires when key is released. onkeypress: The event onkeypress fires if the onkeydown is followed by onkeyup. There are many additional events available in JavaScript. A few are listed below: onerror: onerror event fires when an error occurs. onfocus: When a element gains focus, onfocus event fires or executes. onblur: In contrast to an onfocus event, this event fires when the element loses its focus. Both onfocus and onblur may be used for handling validation of forms. onsubmit: The event onsubmit fires when the command form submit is given. This event is used for validating all fields in the form before submitting the form. onload: onload event automatically executes as soon as the document fully loads. This loads when the user enters the page. This is a commonly used event. This event is used to check compatibility with the browser version and type. Based on this compatibility, the appropriate version of a page will then load. onunload: In contrast to onload event, the onunload event fires when the user leaves the page.