Event-driven events in JavaScript are triggered by mouse or hotkey actions. The main events are as follows:
1. Mouse click event onclick For example: ()
is usually used for the following controls :
button button object
checkbox checkbox or check list--with onclick click event, usually used for all-select effect
radio radio button
reset Set button
submit button
2. Content change event onchange For example: ()
is usually used for
text text input box - with onchange, it can be achieved Effect of registration detection
textarea text area
3. Select eventonselect -- This event is triggered when the content of text or textarea is highlighted
4 , Get focus event onFocus -- Occurs when the object gets focus
5. Lose focus event onBlur -- Corresponds to the focus event!
6. Document loading event onload --The event is triggered when the document is loaded. It is also usually called a loading event (loading operation) and is generally used to set cookies
7. Unload document event onunload --corresponds to the loading document event. Occurs when the web page exits, usually updating the cookie value
8. Mouse right-click menu function event oncontextmenu -- Use
when you can block the right mouse button