Window Event Attributes

title=text

Explanation

Window Event Attributes were set off/happens for the window.
These events should be placed inside the <body>.
These attributes can be added with all the elements to denote an event action.
List of available attributes:
AttributeValueDescription
onafterprint Script When a content is printed successfully, then the script will be executed.
onbeforeprint Script Before printing the content, the script will be executed.
onbeforeonload Script Script will be executed ahead of the content gets loaded.
onblur Script Script will be executed when clicked out of the <body>.
onerror Script Script will be executed when error takes place.
onfocus Script When the screen i.e. window gets focused, then the script will be executed.
onhaschange Script When the contents inside <body> is modified then script will be executed.
onload Script When the content in <body> is loaded, then the script will run.
onmessage Script When the message is set off then the script will be executed.
onoffline Script Script will be executed, when there is interruption in internet connection and site was offline.
ononline Script When the site goes online, then script will be executed.
onpagehide Script When a page is hidded, then script will be executed.
onpageshow Script When a page is shown afer it was hidden, then the script will be executed.
onpopstate Script Script will be executed before the popup menu was displayed.
onredo Script Script will be executed when the "Redo" option was used.
onresize Script When the size of the window/screen was altered, then the script will be executed.
onstorage Script When information in web browser was stored then the script will be executed.
onundo Script When "Undo" option is applied then the script will be executed.
onunload Script If the <body> contents fails to load when the page is loaded, then the script will be executed.

Ask Questions

Ask Question