event handling for JavaScript
1. Event handling
A) JavaScript is an object-and event-driven scripting language
b) When the state of an object changes, the object responds to this change
c) function Funname ([Param[,para ...])
2. Mouse Events - mouse state changes
A) onclick Click event
b) Ondbclick Double-click event
c) onmouseover mouse over the event above the object
d) onmouseout mouse Leave event
e) onmousedown mouse down event
f) onmouseup Mouse release key event
g) onselect selected Events
3. Keyboard events
A) onkeydown key event - triggered when the keyboard is pressed; pressing any key will trigger
b) onkeypress Press the key event - triggered when the keyboard is pressed; occurs after onkeydown; just press the next keyword (Letters, numbers ), excluding function keys ( f1-f12),Ctrl key,Shift key,Alt key, and so on.
c) onkeyup release key event
4.HTML Events
A) OnLoad window Load event -- in page content (Pictures, plugins, controls ...) ) to be executed after the download is complete; typically added in the <body> tab
b) onunload window departure event - - window departure behavior including close, return, refresh, enter address, etc.
c) onresize events triggered by changing the window's large hours -- Specify event handlers in <body>
d) onabort Interrupt Event -triggered only when an interrupt occurs during page loading of an img image element;<img name=" Imgname "src=" "onabort=" Aborthandle () "/>
e) OnError exception event --window object's properties,window.onerror; contains 3 Default parameters: Error message, error page URL, error line number, or add "return True" to the event handler statement if you do not need a system popup error message; "
f) onreset Press the reset button event
g) OnSubmit Press the Submit button event - The handler function must return true/false, or the function body will be ignored; onsubmit='return function() ' "
5. Change Event --change of state caused by change of cursor position
A) onblur loss of focus events - such as validity of the validation date
b) Onfouse get focus events - input box style changes when entering information;onblur,onfouse are often used in conjunction
C) event triggered when onchange value is changed - - triggered only when the value of the event object has changed and the event object loses focus;onchange <select name="" onchange= "Changehandle () to listen to the user's choice to modify the drop-down list ></select>
Event handling for JavaScript