eventPhase property (event)
Returns an integer value that indicates the current processing phase of an event.
- If an event is captured by event listeners, then the event processing starts with the capturing phase. In that phase, the event listeners that capture the event are called.
- After that phase or if the event is not captured, the target phase follows. In that phase, the event is dispatched to the target element.
- Finally, in the last phase (bubbling phase), the event propagates up the DOM hierarchy.
You can find the related objects in the Supported by objects section below.
This property is read-only.
Integer that represents the processing phase. Predefined constants are available for the possible values of this property, in the scope of the Event interface. You can use them directly through the Event interface (Event.CAPTURING_PHASE) or through an instance of the event object. For further details, please see the page for the Event interface.
One of the following values (the value of a predefined constant appears in parentheses after the constant):
|The event flow is in the capturing phase.|
|The event flow is in the target phase.|
|The event flow is in the bubbling phase.|
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the eventPhase property:
Did you find this example helpful?
User Contributed Comments