DOM event object attributes and methods, domevent object

Source: Internet
Author: User

DOM event object attributes and methods, domevent object

Attribute/Method Type Read/write? Description
AltKey Boolean Read/write Indicates whether to press the alt key
Bubbles Boolean Read Indicates whether the event is bubbling.
Button Intrger Read/write

When a mouse event occurs, click the mouse button.

0-No mouse clicks

1-right-click

3-left mouse clicks

4-click the middle mouse button

5-Simultaneously press the left and middle buttons of the mouse

6-Simultaneously press the right button and the middle button

7-at the same time, press the three buttons in the left, middle, and right

Cancelable Boolean Read Indicates whether the event can be canceled
CancelBubble Boolean Read
Indicates whether the event bubble has been canceled.
CharCode Integer Read
Unicode Character Set of the pressed key
ClientX Integer Read
When an event occurs, the X coordinates of the mouse pointer in the client area (excluding the toolbar, scroll bar, and so on)
ClientY
Integer
Read
When an event occurs, the Y coordinate of the mouse pointer in the client area (excluding the toolbar, scroll bar, and so on)
CtrlKey
Boolean
Read
Indicates whether the ctrl key is pressed.
FromElement
Element
Read
Elements removed from a mouse event
Detail Integer Read
Number of clicks
EventPhase Integer Read

The stage of the event. Its role is:

0-capture nodes

1-on the target

3-bubble stage

IsChar Boolean Read

Specifies the numeric representation of the pressed keyboard.

KeyCode Integer Read
Indicates the numeric representation of the pressed keyboard.
PageX Integer Read
The X coordinate of the mouse pointer relative to the page
PageY
Integer
Read
Y coordinate of the mouse pointer relative to the page
PreventDefault () Function
This method can be called to prevent the default behavior of the event.
RelatedTarget Element Read
The next target of an event, which is often used in a mouse event.
ScreenX
Integer
Read
X coordinate of the mouse pointer relative to the entire computer screen
ScreenY
Integer
Read
Y coordinate of the mouse pointer relative to the entire computer screen
ShiftKey Boolean Read
Indicates whether to press shift
StopPropagation () Function
This method can be called to prevent further propagation of time (bubble)
Target Element Read
Trigger event element/Object
TimeStamp Long Read
Event occurrence time (current time minus the number of microseconds after midnight on January 1, January 1, 1970)
Type Strin Read
Event name


Read

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.