Name

Event — details about an event

Availability

JavaScript 1.2; incompatible versions supported by Netscape 4 and IE 4

Synopsis

function handler(event) { ... } // Event handler argument in Netscape 4 
window.event   // Window property in IE 4

Constants

In Netscape 4, the Event object defines bitmask constants for each of the supported event types. These static properties are used to form the bitmasks that are passed to captureEvents( ) and releaseEvents( ). The available constants are:

Event.ABORT
Event.BLUR
Event.CHANGE
Event.CLICK
Event.DBLCLICK
Event.DRAGDROP
Event.ERROR
Event.FOCUS
Event.KEYDOWN
Event.KEYPRESS
Event.KEYUP
Event.LOAD
Event.MOUSEDOWN
Event.MOUSEMOVE
Event.MOUSEOUT
Event.MOUSEOVER
Event.MOUSEUP
Event.MOVE
Event.RESET
Event.RESIZE
Event.SELECT
Event.SUBMIT
Event.UNLOAD

Netscape 4 Properties

height

Set only in events of type “resize”. Specifies the new height of the window or frame that was resized.

layerX, layerY

Specify the X- and Y-coordinates, relative to the enclosing layer, at which an event occurred.

modifiers

Specifies which keyboard modifier keys were held down when the event occurred. This numeric value is a bitmask consisting of any of the constants Event.ALT_MASK, Event.CONTROL_MASK, Event.META_MASK, or Event.SHIFT_MASK. Due to a bug, this property is not defined in Netscape 6 or 6.1.

pageX, pageY

Specify the X- and Y-coordinates, relative to the web browser page, at which the event occurred. Note that these coordinates ...

Get JavaScript: The Definitive Guide, Fourth Edition 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.