Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
DOM event
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== 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. {| class="wikitable" |+Event properties ! Name ! Type ! Description |- | type | DOMString | The name of the event (case-insensitive in DOM level 2 but case-sensitive in DOM level 3 <ref>{{cite web |url=http://www.w3.org/TR/DOM-Level-3-Events/#changes-DOMLevel2to3Changes |title= Document Object Model (DOM) Level 3 Events Specification (working draft) |publisher= [[W3C]] |access-date=2013-04-17}}</ref>). |- | target | EventTarget | Used to indicate the EventTarget to which the event was originally dispatched. |- | currentTarget | EventTarget | Used to indicate the EventTarget whose EventListeners are currently being processed. |- | eventPhase | unsigned short | Used to indicate which phase of event flow is currently being evaluated. |- | bubbles | boolean | Used to indicate whether or not an event is a bubbling event. |- | cancelable | boolean | Used to indicate whether or not an event can have its default action prevented. |- | timeStamp | DOMTimeStamp | Used to specify the time (in milliseconds relative to the epoch) at which the event was created. |- |} {| class="wikitable" |+Event methods ! 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. |- | rowspan=3 | 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. |- |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)