The event object is accessible to all event handlers in all browsers.
The properties of the event object contain additional information about the current event.
To get further details about these properties and the possible event handler registration methods, please see the page for the event object.

The order of events related to the onbeforedeactivate event:

Example HTML code 1:

This example illustrates the use of the onbeforedeactivate event for a button element:

<head><scripttype="text/javascript">function CancelDeActivation (event) {
// prevent the propagation of the current event
if (event.stopPropagation) {
event.stopPropagation ();
}
else {
event.cancelBubble = true;
}
// cancel the current event
returnfalse;
}
</script></head><body>
The second button cannot be deactivated.<br/>
Activate it first (click on it or use the TAB key to navigate through the buttons or press the ALT+2 access key)
and try to deactivate it!
<br/><br/><buttonaccesskey="1">ALT + 1</button><buttonaccesskey="2"onbeforedeactivate="return CancelDeActivation (event);">ALT + 2</button><buttonaccesskey="3">ALT + 3</button></body>

Example HTML code 2:

This example illustrates the use of the onbeforedeactivate event for an input:text element:

<head><scripttype="text/javascript">function CancelDeActivation (event) {
// prevent the propagation of the current event
if (event.stopPropagation) {
event.stopPropagation ();
}
else {
event.cancelBubble = true;
}
// cancel the current event
returnfalse;
}
</script></head><body>
The second text field cannot be deactivated.<br/>
Activate it first (click on it or use the TAB key to navigate through the controls or press the ALT+2 access key)
and try to deactivate it!
<br/><br/><inputaccesskey="1"value="ALT + 1"/><inputaccesskey="2"value="ALT + 2"onbeforedeactivate="return CancelDeActivation (event);"/><inputaccesskey="3"value="ALT + 3"/></body>