document.handleEvent()

JavaScript 1.2+ Nav4+ Syntax

document.handleEvent(event)

Description

The handleEvent() method provides a way to invoke a document's event handler, even though the event never happened. The argument associated with this method is listed in Table 7.15.

Table 7.15. Argument associated with the handleEvent() method.
Type Item Description
Argument event An event object to be handled

Example

In Listing 7.102, an event handler is designated to handle all document Click events. When the user selects the button labeled 9, the eventHandler() method is used to route the event to the document's event handler.

Listing 7.102 Pass Events to Document with the handleEvent() Method
 <html> <h2>Math Quiz</h2> What is 6+3? <form ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.