Event Attributes in HTML

Window Event Attributes

Attribute Description
onafterprint Script executed after the document is printed
onbeforeprint Script executed before the document is printed
onbeforeunload Script executed before a document being unloaded
onerror Script executed when an error occurs
onhashchange Script executed when there has been changes to the anchor part of the a URL
onload Fires after the page is finished loading
onmessage Script executed when a message event occurs
onoffline Script executed when the browser starts to work offline
ononline Script executed when the browser starts to work online
onpagehide Script executed when a user navigates away from a page
onpageshow Script executed when a user navigates to a page
onpopstate Script executed when the window's history changes
onresize Script executed when the window is resized
onstorage Script executed when web storage area is updated
onunload Script executed when the current webpage is unloaded, or window is closed

Form Event Attributes

Attribute Description
onblur Script executed when form element loses the focus
onchange Script executed when the value of the element is changed
oncontextmenu Script executed when a context menu is triggered
onfocus Script executed when the element gets focus
oninput Script executed when the user enters input to the element
oninvalid Script to be run when an element is invalid
onreset Script executed when the Reset button in a form is clicked
onsearch Triggers the event when a search field receives some input
onselect Fires after some text has been selected in an element
onsubmit Script executed when a form is submitted

Email Us: advertise@gdatamart.com

Donate Us: Support to GDATAMART

© 2023 GDATAMART.COM (All Rights Reserved)