An event handler executes segment of code depend on certain events occurring in the application, like onClick or onLoad. JavaScript event handlers can be divided in two parts: non-interactive event handlers and interactive event handlers. An interactive event handler is one which based on user interaction along with the form or the document.
For instance, onMouseOver is an interactive event handler since it based on the user's action with the mouse. An instance of non-interactive event handler is onLoad, as it executes JavaScript code automatically without the requirement for user interaction. Here are all the event handlers obtainable in JavaScript.