
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
What is an event in JavaScript?
JavaScripts interaction with HTML is handled through events that occur when the user or the browser manipulates a page.
When the page loads, it is called an event. When the user clicks a button, that clicks to is an event. Other examples include events like pressing any key, closing a window, resizing a window, etc.
Developers can use these events to execute JavaScript coded responses, which cause buttons to close windows, messages to be displayed to users, data to be validated, and virtually any other type of response imaginable.
Some of the standard HTML 5 events are listed below −
Attribute | Value | Description |
Offline | script | Triggers when the document goes offline |
Onabort | script | Triggers on an abort event |
Onafterprint | script | Triggers after the document is printed |
onbeforeonload | script | Triggers before the document loads |
onbeforeprint | script | Triggers before the document is printed |
Onblur | script | Triggers when the window loses focus |
Oncanplay | script | Triggers when media can start play but might have to stop for buffering |
oncanplaythrough | script | Triggers when media can be played to the end, without stopping for buffering |
Onchange | script | Triggers when an element changes |
- Related Articles
- What is the usage of an abort event in JavaScript?
- What is oncontextmenu event in JavaScript?
- What is ondblclick event in JavaScript?
- What is onmousedown event in JavaScript?
- What is onmouseenter event in JavaScript?
- What is onmouseleave event in JavaScript?
- What is onmousemove event in JavaScript?
- What is onmouseover event in JavaScript?
- What is onmouseout event in JavaScript?
- What is onmouseup event in JavaScript?
- What is onkeydown event in JavaScript?
- What is onkeypress event in JavaScript?
- What is onsubmit event in JavaScript?
- What is onkeyup event in JavaScript?
- What is onclick event in JavaScript?

Advertisements