HTML5 Events List

"An event is an unexpected external occurrence".

Most JavaScript-applications perform actions as a response to the event. An event is a signal from the browser that something has happened. In HTML, you can attach event to any specifc HTML DOM element and implement any action that you want to perform when event triggers. Learn more about Javascript events, please visit JavaScript tutorial.

Window Events Attributes

The below table contains document events list which are supported by HTML5 version.

Event NameEvent Description
onafterprintThis event will encounter after page is printed.
onbeforeprintThis event will encounter before page is printed.
onhashchangeThis event will encounter when changes occure in anchor part of the a URL.
onstorageThis event will encounter when a web storage is updated.
onbeforeunloadThis event will encounter when the page is about to be unloaded.
onmessageThis event will encounter when message is triggered.
ononlineThis event will encounter when the browser works online.
onofflineThis event will encounter when the browser works offline.
onpageshowThis event will encounter when a user navigates to a page.
onresizeThis event will encounter when the resized browser window.
onunloadThis event will encounter when page has unloaded.
onpagehideThis event will encounter when a user move to another page.
onpopstateThis event will encounter when the window's history changes.

Form Events

The below table contains form events list which are supported by HTML5 version.

Event NameEvent Description
oninputThis event will encounter when an input element gets user input.
oninvalidThis event will encounter when an element is invalid.
onresetThis event will encounter when user reset form.
oncontextmenuThis event will encounter when a context menu is triggered.

Mouse Events

The below table contains mouse events list which are supported by HTML5 version.

Event NameEvent Description
ondropThis event will encounter when dragged element has been dropped.
ondragstartThis event will encounter when start drag operation.
ondragleaveThis event will encounter when an element leaves a valid drop target.
ondragoverThis event will encounter when the element is being dragged over a valid drop target.
ondragenterThis event will encounter when element has been dragged to a valid drop target.
ondragThis event will encounter when element is dragged.
ondragendThis event will encounter when drag operationv completed.

Media Events

The below table contains media events list which are supported by HTML5 version.

Event NameEvent Description
onabortThis event will encounter when loading of a resource(image, file or object) has been aborted.