http://www.w3.org/wiki/DOM/domcore/Event
DOM/domcore/Event
Event
The Event interface is used to provide contextual information about an event to the listener processing the event. An object which implements the Event interface must be passed as the parameter to an EventListener. The object passed to the event listener may also implement derived interfaces that provide access to information directly relating to the type of event they represent.
Attributes
| Name | Description |
|---|---|
type | Returns the name of the event. |
target | Indicates the event target. |
currentTarget | Indicates the EventTarget whose EventListeners are currently being processed. |
eventPhase | Indicates which phase of event flow is currently being accomplished. |
bubbles | Indicates whether or not an event is a bubbling event. |
cancelable | Indicates whether or not an event can have its default action prevented. |
defaultPrevented | Indicates whether Event.preventDefault() has been called for this event. |
isTrusted | Indicates whether this event was generated by the user agent (trusted) or by script (untrusted). |
timeStamp | Returns the time that the event was created. |
Methods
| Name | Description |
|---|---|
stopPropagation() | Prevents other event listeners from being triggered. |
stopImmediatePropagation() | Prevents other event listeners from being triggered. Its effect must be immediate |
preventDefault() | Cancels the event. |
initEvent(type, bubbles, cancelable) | Initializes attributes of an Event. |
本文详细介绍了DOM核心中的事件对象,包括其属性和方法,帮助开发者更好地理解事件处理流程。

被折叠的 条评论
为什么被折叠?



