Common JavaScript Events Table
Event Attribute | Description |
---|---|
onclick | Triggered when an element is clicked. |
onmouseover | Fired when the mouse pointer moves over an element. |
onmouseout | Occurs when the mouse pointer leaves an element. |
onkeydown | Fired when a key is pressed down. |
onkeyup | Fired when a key is released. |
onchange | Triggered when the value of an input element changes. |
onload | Occurs when a page has finished loading. |
onsubmit | Fired when a form is submitted. |
onfocus | Occurs when an element gets focus. |
onblur | Fired 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">