The Event Model
The event model supports a full range of user events. These events are ones the user can generate by mouse, keyboard, focus, and other specialist events.
The following sections discuss some of the events Internet Explorer 5.5 supports.
onClick Event
This event fires when the user clicks the left mouse button in the document.
onContextmenu Event
This event fires when the user clicks the right mouse button in the document area to open the context menu. Using this event enables you to run a script before the context menu pops up or to disable it completely (see Figure 14.12). You can cancel an event by using the event.returnValue property and setting this to false. This causes the default event, which should occur, to be lost. Here's ...
Get JavaScript™ 1.5 by Example 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.