HTML Events

By | February 16, 2020

In this chapter, we will learn about the events of HTML in details, we had already known about some types of events, in this we will know about them in details, these events can be of many types.The browser responds when it uses an action known as an event. In HTML such events can be activated using a programming language like JavaScript.

Below are some events, let’s look at them carefully.

Windows Event:-

AttributeDescription
onafterprint The script is executed after the document is printed.
onbeforeprint The script is executed before the document is printed.
onbeforeunload The script has been executed before the document landed.
onerror Script is executed when an error occurs.
onhashchange Changing anchor in web page URL exited script.
onload The script is executed when the webpage is fully loaded.
onmessage The script is executed when a message occurs.
onoffline Out of the network, the script went out of the way and the browser started working offline.
ononlinne Exited the script but the browser started working online.
onpagehide The script is executed when the current web page is hidden.
onpageshow The script is executed when the current web page is centered.
onpopstate The script is executed when the window history is changed.
onresize The script is executed when the window is changed.
onstorage Script is executed when web storage is updated.
onunload Script closes or window closes when current web page leads

Form Event:-

AttributeDescription
onblur The script is executed when the element loses focus.
onchange The script has to be executed instead of the value of the element.
onfocus Triggers an event to occur when the element is centered.
oninput The script executes when the user enters input into the element.
oninvalid The script is executed if the element does not remove its predetermined boost.
onreset An event is triggered by resetting the form as if using.
onsearch Triggers the event when the input field receives some input.
onselect Triggering of this event when using select some path.
onsubmit This triggers an event when the form is submitted.

Keyboard Event:-

Attribute Description
onkeydown This triggers an event when the user presses a key on the keyboard.
onkeypress The event is triggered when a key is pressed by the user and some digits are displayed.
onkeyup The event is triggered when a key is pressed by the currently used.

Clipboard Event:-

Attribute Description
oncopy Uses triggered upon copying to system clipboard.
oncut The event is triggered when the content of an element is copied to the clipboard when it is cut.
onpaste The event is triggered when the material is stuck in an element by the user.

Media Event:-

Attribute Description
onabort Script executes when media playback is aborted.
oncanplay Script executes when media files are played.
oncanplaythrough The script executes when the media file plays without a stop.
oncuechange The script of the trek element is executed.
ondurationchange Script executes when media file duration changes.
onemptied If an error occurs in the media file, the file becomes invalid then the script executes.
onended The script executes when the media file is finalized.
onerror Script executes when error occurs on receiving media data.
onloadeddata Script executes when media data is loaded.
onloadedmetadata Script executes when media file votes are loaded.
onloadstart The script executes when the media file is loaded.
onpause Script executes when media playback is stopped.
onplay The script executes when the media file stops playing.
onplaying The script executes when media files are played.
onprogress The script executes when the browser receives media data.
onratechange The script executes when the playback speed changes.
Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *