Common JavaScript Events Table

Event AttributeDescription
onclickTriggered when an element is clicked.
onmouseoverFired when the mouse pointer moves over an element.
onmouseoutOccurs when the mouse pointer leaves an element.
onkeydownFired when a key is pressed down.
onkeyupFired when a key is released.
onchangeTriggered when the value of an input element changes.
onloadOccurs when a page has finished loading.
onsubmitFired when a form is submitted.
onfocusOccurs when an element gets focus.
onblurFired when an element loses focus.

JavaScript Events

JavaScript Events are actions or occurrences that happen in the browser. They can be triggered by various user interactions or by the browser itself.

Common events include mouse clicks, keyboard presses, page loads, and form submissions. Event handlers are JavaScript functions that respond to these events, allowing developers to create interactive web applications.

Syntax:

<HTML-element Event-Type = "Action to be performed">

Similar Reads

Common JavaScript Events Table

Event AttributeDescriptiononclickTriggered when an element is clicked.onmouseoverFired when the mouse pointer moves over an element.onmouseoutOccurs when the mouse pointer leaves an element.onkeydownFired when a key is pressed down.onkeyupFired when a key is released.onchangeTriggered when the value of an input element changes.onloadOccurs when a page has finished loading.onsubmitFired when a form is submitted.onfocusOccurs when an element gets focus.onblurFired when an element loses focus....

1. JavaScript Events Examples

Example 1: Here, we will display a message in the alert box when the button is clicked using onClick() event. This HTML document features a button styled to appear in the middle of the page. When clicked, the button triggers the `hiThere()` JavaScript function, which displays an alert box with the message “Hi there!”....

2. JavaScript Event Handlers

JavaScript event handlers are functions that are executed in response to specific events occurring in the browser....