Curriculum
Course: JavaScript Basic
Login

Curriculum

JavaScript Basic

JSHome

0/216
Text lesson

Common HTML Events

Below is a compilation of some frequently encountered HTML events:

Event

                                                    Description

onchange

                                An HTML element has been modified.

onclick

                              The user interacts with an HTML element by clicking it.

onmouseover

                               The user hovers the mouse over an HTML element.

onmouseout

                               The user moves the mouse away from an HTML element.

onkeydown

                                The user presses a key on the keyboard.

onload

                                The browser has completed loading the page.

JavaScript Event Handlers

Event handlers serve to manage and validate user input, user interactions, and browser actions:

  • Tasks to be executed consistently upon page loading
  • Procedures to be executed upon page closure
  • Actions triggered by user button clicks
  • Data validation procedures upon user input
  • And additional functionalities

Various approaches exist for enabling JavaScript to interact with events:

  • HTML event attributes capable of directly executing JavaScript code
  • HTML event attributes capable of invoking JavaScript functions
  • Assignment of custom event handler functions to HTML elements
  • Implementation of measures to prevent event propagation or handling And more.
You will gain deeper insights into events and event handlers in the HTML DOM chapters.