Event object in DOM
Introducing the Event object into DOM (the DOM browser is the standard browser)
(1) Pass the event through the event attribute of the HTML mark Object
In the DOM, the event object is passed to the function as a parameter when the event calls the function.
The event parameter is a fixed writing method of the system. It is all lowercase and cannot be quoted. It is the event object parameter.
php.cn
(2) Use the event attribute of the element object to pass the event object
php.cn
##Event object properties in DOM
- type: the current event type
- clientX and clientY: distance from the left and top of the window
- pageX and pageY: distance from the left and top of the web page
- screenX and screenY: distance from the left and top of the screen
php.cn