Browser/User Agent Support
| IE | Mozilla | Netscape | Opera | Safari | Netscapte | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
|---|
Constructors
| Constructor | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
Provides information about an event. | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
Properties
| Property | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
Specifies the Abstract content of the entry banner for an ASX file. | 6.0+ | no | no | no | no | no |
If true, the ALT key is currently being pressed. | 6.0+ | 1.75+ | no | no | 1.2+ | no |
If true, the left ALT key is currently being pressed. | 6.0+ | no | no | no | no | no |
Specifies the Banner content of the entry for an ASX file. | 6.0+ | no | no | no | no | no |
Specify true if the event type bubbles. Otherwise, false. | no | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
Specifies the mouse button that was clicked. Valid values are 0 = No button pressed. 1 = Left button pressed. 2 = Right button pressed. 3 = Left and right buttons both pressed. 4 = Middle button pressed. 5 = Left and middle buttons pressed. 6 = Right and middle buttons are both pressed. 7 = All three buttons pressed. | 5.0+ | no | no | no | no | no |
True if the action of the event can be cancelled with the preventDefault()method. Otherwise, false. | no | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
If true, bubbling is disabled for the event. | 5.0+ | no | no | no | no | no |
Specifies the x-coordinate (in pixels) of the mouse relative to the client window. | 4.0+ | 1.75 | no | 8.0+ | 1.2 | no |
| ||||||
Specifies the y-coordinate (in pixels) of the mouse relative to the client window. | 4.0+ | 1.75 | no | 8.0+ | 1.2 | no |
| ||||||
If true, overflow content should be formatted using a new LayoutRect object. | 6.0+ | no | no | no | no | no |
If true, the CTRL key is currently being pressed. | 5.0+ | 1.75 | no | 8.0+ | 1.2 | no |
If true, the left CTRL key is currently being pressed. | 6.0+ | no | no | no | no | no |
Node of the Document that is handling the event. | no | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
Specifies the data column in the current recordset. | 6.0+ | no | no | no | no | no |
Phase that the event is currently in. See Remarks for a list of valid values. | no | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
Specifies the element that was the previous location of the pointer or cursor. | 5.0+ | no | no | 8.0+ | 1.2+ | no |
Specifies the Unicode key code for the event.. | 6.0+ | 1.75+ | no | 8.0+ | 1.2+ | no |
Specifies the MoreInfo content of the entry banner for an ASX file. | 6.0+ | no | no | no | no | no |
Specifies position of the next page for printing. Valid values are | 6.0+ | no | no | no | no | no |
Specifies position of the next page for printing. Valid values are "left", "right", and "". | 6.0+ | no | no | no | no | no |
Specifies the x-coordinate (in pixels) of the mouse relative to the object that is firing the event. | 5.0+ | no | no | 8.0+ | 1.2+ | no |
Specifies the y-coordinate (in pixels) of the mouse relative to the object that is firing the event. | 5.0+ | no | no | 8.0+ | 1.2+ | no |
Specifies the name of the property whose value changes. | 5.0+ | no | no | no | no | no |
Specifies the name of the data member from the data source. | 5.0+ | no | no | no | no | no |
Specifies the result of a data transfer for a data source. Valid values are 0 = success, 1 = transfer aborted, 2 = error. | 5.0+ | no | no | no | no | no |
Specifies the result of a data transfer for a data source. Valid values are 0 = success, 1 = transfer aborted, 2 = error. | 5.0+ | no | no | no | no | no |
If true, specifies that the onkeydown event was repeated. | 6.0+ | no | no | no | no | no |
If true, the value from the event is returned. | 6.0+ | no | no | no | no | no |
Specifies either "TEXT" or "HTML" as the clipboard type when the oncontentsave event fires. | 6.0+ | no | no | no | no | no |
Specifies the x-coordinate (in pixels) of the mouse relative to the screen. | 5.0+ | 1.75+ | no | 8.0+ | 1.2+ | no |
Specifies the y-coordinate (in pixels) of the mouse relative to the screen. | 5.0+ | 1.75+ | no | 8.0+ | 1.2+ | no |
If true, the SHIFT key is currently being pressed. | 5.0+ | 1.75+ | no | 8.0+ | 1.2+ | no |
If true, the left SHIFT key is currently being pressed. | 6.0+ | no | no | no | no | no |
Element that fired or received the event. | 5.0+ | no | no | 8.0+ | 1.2+ | no |
| ||||||
Object that caused the onfilterchange event to fire. | 5.0+ | no | no | no | no | no |
Specifies the URN for the behavior that fired the event. | 5.0+ | no | no | no | no | no |
Target node for the event. | no | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
Date and time that the event occurred. | no | 1.75+ | no | no | 1.2+ | no |
| ||||||
Specifies the element that the mouse pointer is moving toward. | 5.0+ | no | no | 8.0+ | 1.2+ | no |
Type of event. | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
Specifies the sFriendlyName parameter for the useService method. | 6.0+ | no | no | no | no | no |
Specifies distance and direction that the mouse wheel has scrolled. | 6.0+ | no | no | no | no | no |
Specifies the x-coordinate (in pixels) of the mouse relative to the parent element. | 5.0+ | no | no | no | 1.3 | 4.0 |
| ||||||
Specifies the y-coordinate (in pixels) of the mouse relative to the parent element. | 5.0+ | no | no | no | 1.3 | 4.0 |
| ||||||
Methods
| Method | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
Initializes the properties of an Event. | no | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
Prevents the default action for the event. | no | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
Stops the propagation of an event. | no | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
Remarks
Whenever some event occurs with the DOM, different event handlers are given the choice of
intercepting and doing something with it. The Event object is used to provide
context that each event handler can use to get information about the event, like the originating
element, what stage the event is currently in within the event system, and so forth.
More specific events, that provide additional context information based on the type of event.
For instance, the MouseEvent object, which inherits from Event,
supplies additional properties supplying information such as the
Due to this, the properties and methods supported by the Event object are rather
minimal, and supply the basic set of functionality required for all types of events.
References
EventListener | EventTarget | MouseEvent | UIEvent
Availability
HTML DOM Level 2 | W3C
Constructor Detail
Property Detail
String Abstract - read only
Specifies the Abstract content of the entry banner for an ASX file.
Boolean altKey - read only
If true, the ALT key is currently being pressed.
-
For examples, see the quirksmode test page:
Boolean altLeft - read only
If true, the left ALT key is currently being pressed.
-
For examples, see the quirksmode test page:
String Banner - read only
Specifies the Banner content of the entry for an ASX file.
Boolean bubbles - read only
Specify true if the event type bubbles. Otherwise, false.
- Remarks
- A bubbling event will continue unless
stopPropagation()is called on the event. - Availability
HTML DOM Level 2 | W3C
Number button
Specifies the mouse button that was clicked. Valid values are 0 = No button pressed. 1 = Left button pressed. 2 = Right button pressed. 3 = Left and right buttons both pressed. 4 = Middle button pressed. 5 = Left and middle buttons pressed. 6 = Right and middle buttons are both pressed. 7 = All three buttons pressed.
Boolean cancelable - read only
True if the action of the event can be cancelled with the preventDefault()method. Otherwise, false.
- Availability
HTML DOM Level 2 | W3C
Boolean cancelBubble
If true, bubbling is disabled for the event.
Number clientX
Specifies the x-coordinate (in pixels) of the mouse relative to the client window.
-
For examples, see the quirksmode test page:
Number clientY
Specifies the y-coordinate (in pixels) of the mouse relative to the client window.
-
For examples, see the quirksmode test page:
Boolean contentOverflow - read only
If true, overflow content should be formatted using a new LayoutRect object.
Boolean ctrlKey - read only
If true, the CTRL key is currently being pressed.
-
For examples, see the quirksmode test page:
Boolean ctrlLeft - read only
If true, the left CTRL key is currently being pressed.
-
For examples, see the quirksmode test page:
EventTarget currentTarget - read only
Node of the Document that is handling the event.
-
For examples, see the quirksmode test page:
- Remarks
-
During the capturing and bubbling phases of event processing, the
Eventobject will be passed around to variousEventListeners. The value of this property will point to theEventTargetNodewithin the DOM where thisEventis currently being evaluated. - Availability
HTML DOM Level 2 | W3C
String dataFld
Specifies the data column in the current recordset.
Number eventPhase - read only
Phase that the event is currently in. See Remarks for a list of valid values.
- Remarks
-
The following constants are valid values for
eventPhase:CAPTURING_PHASE = 1- Indicates that the event is in the capturing phase.AT_TARGET = 2- Indicates that the event is being handled by its target node.BUBBLING_PHASE = 3- Indicates that the event is bubbling.
- Availability
HTML DOM Level 2 | W3C
Element fromElement
Specifies the element that was the previous location of the pointer or cursor.
-
For examples, see the quirksmode test page:
Number keyCode
Specifies the Unicode key code for the event..
-
For examples, see the quirksmode test page:
Number MoreInfo - read only
Specifies the MoreInfo content of the entry banner for an ASX file.
String nextPage - read only
Specifies position of the next page for printing. Valid values are
String nextPage - read only
Specifies position of the next page for printing. Valid values are "left", "right", and "".
Number offsetX
Specifies the x-coordinate (in pixels) of the mouse relative to the object that is firing the event.
-
For examples, see the quirksmode test page:
Number offsetY
Specifies the y-coordinate (in pixels) of the mouse relative to the object that is firing the event.
-
For examples, see the quirksmode test page:
String propertyName
Specifies the name of the property whose value changes.
String qualifier
Specifies the name of the data member from the data source.
Number reason - read only
Specifies the result of a data transfer for a data source. Valid values are 0 = success, 1 = transfer aborted, 2 = error.
Number recordSet - read only
Specifies the result of a data transfer for a data source. Valid values are 0 = success, 1 = transfer aborted, 2 = error.
Boolean repeat
If true, specifies that the onkeydown event was repeated.
-
For examples, see the quirksmode test page:
Boolean returnValue
If true, the value from the event is returned.
String saveType - read only
Specifies either "TEXT" or "HTML" as the clipboard type when the oncontentsave event fires.
Number screenX
Specifies the x-coordinate (in pixels) of the mouse relative to the screen.
-
For examples, see the quirksmode test page:
Number screenY
Specifies the y-coordinate (in pixels) of the mouse relative to the screen.
-
For examples, see the quirksmode test page:
Boolean shiftKey - read only
If true, the SHIFT key is currently being pressed.
-
For examples, see the quirksmode test page:
Boolean shiftLeft - read only
If true, the left SHIFT key is currently being pressed.
-
For examples, see the quirksmode test page:
Element srcElement
Element that fired or received the event.
-
For examples, see the quirksmode test page:
Object srcFilter
Object that caused the onfilterchange event to fire.
String srcURN
Specifies the URN for the behavior that fired the event.
EventTarget target - read only
Target node for the event.
-
For examples, see the quirksmode test page:
- Remarks
-
Tracks the
EventTargetthat this event originated from. This is aNodethat implements the necessary methods to function as a target for DOM events, and can be used as such. - Availability
HTML DOM Level 2 | W3C
Date timeStamp - read only
Date and time that the event occurred.
-
For examples, see the quirksmode test page:
- Availability
HTML DOM Level 2 | W3C
Element toElement
Specifies the element that the mouse pointer is moving toward.
-
For examples, see the quirksmode test page:
String type - read only
Type of event.
-
For examples, see the quirksmode test page:
- Remarks
- Not case sensitive.
- Availability
HTML DOM Level 2 | W3C
String userName - read only
Specifies the sFriendlyName parameter for the useService method.
Number wheelData - read only
Specifies distance and direction that the mouse wheel has scrolled.
Number x
Specifies the x-coordinate (in pixels) of the mouse relative to the parent element.
-
For examples, see the quirksmode test page:
Number y
Specifies the y-coordinate (in pixels) of the mouse relative to the parent element.
-
For examples, see the quirksmode test page:
Method Detail
initEvent(String eventTypeArg, Boolean canBubbleArg, Boolean cancelableArg) : void
Initializes the properties of an Event.
| String | eventTypeArg | Type of event. |
| Boolean | canBubbleArg | Specify "true" if the event will bubble. |
| Boolean | cancelableArg | Specify "true" if the preventDefault() method can cancel the event. |
- Availability
HTML DOM Level 2 | W3C
preventDefault() : void
Prevents the default action for the event.
- Remarks
- If the
cancelableproperty for the event is set to false, the event either has no default action, or thepreventDefaultmethod will not be able to prevent the default action. - Availability
HTML DOM Level 2 | W3C
stopPropagation() : void
Stops the propagation of an event.
- Remarks
- Prevents the event from being dispatched to other nodes. Does not prevent other event callers from being called on the node.
- Availability
HTML DOM Level 2 | W3C
