Events and Event Handlers

Event handlers

An event handler executes a segment of a code based on certain events occurring within the application, such as onLoad, onClick.

JavaScript event handers can be divided into two parts: interactive event handlers and non-interactive event handlers.

An interactive event handler is the one that depends on the user interactivity with the form or the document. For example, onMouseOver is an interactive event handler because it depends on the users action with the mouse.

On the other hand non-interactive event handler would be onLoad, because this event handler would automatically execute JavaScript code without the user's interactivity.

Here are all the event handlers available in JavaScript:

Other Handlers :

document.onpointerlockchange

Returns the event handling code for the pointerlockchange event.

document.onpointerlockerror

Returns the event handling code for the pointerlockerror event.

document.onreadystatechange

Returns the event handling code for the readystatechange event.

Events

  • onafterupdate

  • onbeforeupdate

  • onclick

  • onchange

  • ondblclick

  • ondragstart

  • onerrorupdate

  • onhelp

  • onkeydown

  • onkeypress

  • onkeyup

  • onmousedown

  • onmousemove

  • onMouseOut

  • onMouseOver

  • onmouseup

  • onreadystatechange

  • onrowenter

  • onrowexit

  • onselectstart