August 1999
Intermediate to advanced
1488 pages
72h 53m
English
document.onMouseDown
The onMouseDown event handler specifies what should happen when the mouse button is pressed within the Document object.
In Listing 7.152, the script in the <head> of the document specifies a function to handle all MouseDown events in the document. To be able to do this, the document's captureEvents() method is used to capture all events of type Event.MOUSEDOWN. When the mouse button is pressed within the page, the document's event handler generates an alert box notifying the user of the event.
<html> <head> <script language="JavaScript1.2"> <!-- Hide ... |
Read now
Unlock full access