asp.net.ph

Skip Navigation Links

onunload Event


Fires immediately before the object is unloaded.

Syntax

Inline <element onunload = "handler" ... >
Script object.onunload = handler

Remarks

Bubbles No
Cancels No
To invoke Cause the browser to unload the object.
Default action Removes the object or document from the browser window.

An unload event occurs when the user agent removes a document from a window or frame.

This event is valid for the BODY and FRAMESET elements.

Event Object Properties

While event handlers in the Document Object Model do not receive parameters directly, the handler can query the event object for data.

Event Object Properties


Example

The example shows how to use the onunload event to run script when the window object has been unloaded.

Sample Code


Applies To

FRAMESET, IMG, window

See Also

onload, onreadyStatechange


Need a break ?
Suggested Reading

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph.

If you have any question, comment or suggestion,
please send us a note