Event Object
The Event object provides a lot of information about a particular event, including information about target element, key pressed, mouse button pressed, mouse position, etc. Unfortunately, there are very serious browser incompatibilities in this area. Hence only the W3C Event object is discussed in this article.
Type | Name | Description |
---|---|---|
DOMString | type | The name of the event (case-insensitive). |
EventTarget | target | Used to indicate the EventTarget to which the event was originally dispatched. |
EventTarget | currentTarget | Used to indicate the EventTarget whose EventListeners are currently being processed. |
unsigned short | eventPhase | Used to indicate which phase of event flow is currently being evaluated. |
boolean | bubbles | Used to indicate whether or not an event is a bubbling event. |
boolean | cancelable | Used to indicate whether or not an event can have its default action prevented. |
DOMTimeStamp | timeStamp | Used to specify the time (in milliseconds relative to the epoch) at which the event was created. |
Name | Argument type | Argument name | Description |
---|---|---|---|
stopPropagation | To prevent further propagation of an event during event flow. | ||
preventDefault | To cancel the event if it is cancelable, meaning that any default action normally taken by the implementation as a result of the event will not occur. | ||
initEvent | DOMString | eventTypeArg | Specifies the event type. |
boolean | canBubbleArg | Specifies whether or not the event can bubble. | |
boolean | cancelableArg | Specifies whether or not the event's default action can be prevented. |
Read more about this topic: DOM Events
Famous quotes containing the words event and/or object:
“I feared these present years,
The middle twenties,
When deftness disappears,
And each event is
Freighted with a source-encrusting doubt,
And turned to drought.”
—Philip Larkin (19221986)
“The division between the useful arts and the fine arts must not be understood in too absolute a manner. In the humblest work of the craftsmen, if art is there, there is a concern for beauty, through a kind of indirect repercussion that the requirements of the creativity of the spirit exercise upon the production of an object to serve human needs.”
—Jacques Maritain (18821973)