1. Event Source
Any element can be used as the source of the event
2. Events
Mouse class
Click//
Dbclick//Double-click
ContextMenu//Right-click menu
MouseOver//Move in
Mouseout//Move out
MouseDown//Press
MouseUp//Bounce up
MouseMove//Mobile
Selected//select content
Keyboard class
KeyPress//keyboard events (only numbers \ Letters)
KeyUp//Bounce (all keys supported)
KeyDown//press (all keys supported)
Form class
Focus//Get focused
Blur//Lose focus
Submit//Submission
Change//Content changes
Document class
Load//Load complete
Unload//Off
Beforeunload//Before closing
Scroll//page scrolling
3. Event handlers
Add Event
<a onclick= "event handlers" > Processing </a>
<script> object. onclick= "Event handlers" </script>
Let the event not execute
Onclick= "return False"
4. Event Object
Event//Belongs to Window object (ie only supported)
Function (e) {//compatible with FF
var event= e | | window.event;//Resolving Object Compatibility
var keycode= event.charcode | | event.keycode;//Resolving keyboard code compatibility
var eventelement= event.srcelement | | eventtag.target;//Resolving Event Source Compatibility
}
event.srcelement//Event Source
event.keycode//keyboard code \ Occurs when performing keyboard events
Enter 13 left upper right bottom 37 38 39 40
event.clientx//Mouse to the left side of the browser window (to add PX units)
event.clienty//the distance between the mouse and the top of the browser window
event.screenx//Mouse to the left of the screen
event.screeny//Mouse to top of screen
event.cancelbubble//Block Event bubbling (that is, passing up layers)
@zhnoah
Source: http://www.cnblogs.com/zhnoah/
This article is owned by me and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original
The right to pursue legal liability.
JavaScript Learning note--6. Event handling