Write in front:
A sentence as the core of this article: Object monitoring event, event trigger function;
(i) Events
1. Event classification
(1) Mouse events
Click () mouse clicks
DblClick () mouse double-click
MouseOver () mouse move-in event
Mouseout () mouse out event
MouseMove () mouse Move Event
MouseDown () mouse down event
MouseUp () mouse button is released event
Scroll scrolling event (body)
(2) Keyboard events
KeyDown Keyboard Press
KeyUp keyboard Lift
(3) Touch Event
Touchstart
Touchmove
Touchend
(4) Form events
Submit a form when the user submits an event
The text of the Select text box is selected
Focus Get Spotlight Event
Blur Lost Focus Event
Change Content Changes Event
(5) Page load Complete event
Load page is finished loading
2. Monitoring Events
(1) on the HTML tag, use on to monitor
<button onclick= "Check ()" > Click Trigger Event </button>
<script type= "Text/javascript" >
function Check () {
Alert (' Hello ');
}
</script>
(2) Monitor user behavior with JavaScript
<button > Click Trigger Event </button>
<script type= "Text/javascript" >
OBTN = document.getElementsByTagName (' button ');
Obtn[0].onclick = function Check () {
Alert (' Hello ');
}
</script>
(3) Binding event listener
AddEventListener (' Event type ', event-generated behavior function, True/false)
Attachevent (' event type ', ' Event execution function ') monitors events for browsers below IE8
This part of the content is often simple, remember the commonly used on listening, remember to click the event clicked, the other routines are the same;
Replace Click on OK!
JS Event-Object monitoring event, event trigger function