O'Reilly logo

JavaScript™ 1.5 by Example by Kathie Kingsley-Hughes, Adrian Kingsley-Hughes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required