Event.MOUSEDOWN

JavaScript 1.2+, JScript 3.0+ Nav4+, IE 4+ Syntax

Event.MOUSEDOWN

Description

The MOUSEDOWN property of the Event object is used by button objects, documents, and links to indicate when the mouse button is pressed by the user.

Example

Listing 7.229 shows how to use the MOUSEDOWN property to determine when the mouse has been pressed down. The onMouseDown event handler is used to catch the MOUSEDOWN event. When it is caught, an alert box is used to inform the user that the event has just occurred.

Listing 7.229 Accessing MOUSEDOWN Property
 <html> <head> <title>Using Event.MOUSEDOWN</title> </head> <body> <script language = "JavaScript"> <!--Hide // sets up the window to capture MOUSEDOWN events window.captureEvents(Event.MOUSEDOWN); ...

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.