HTML | onunload Event Attribute
The onunload event attribute works when the document is being unloaded i.e. it occurs when the browser has been closed. It is mostly used when the user open link and submit the form and close the browser window.
<element onunload = "script">
Attribute Value: This attribute contains single value script which works when onunload event triggered.
Note: This event may not work always as expected.
Supported Browsers: The browser supported by onunload event attribute are listed below:
- Google Chrome 1
- Edge 12
- Internet Explorer 4
- Firefox 1
- Safari 3
- Opera 4