Deep understanding of event-driven basics in JavaScript

Source: Internet
Author: User
Event-driven in JavaScript is the main event that is raised by the action of a mouse or hotkey as follows:
1, mouse click event onclick such as: (<input type= "button" value= mouse click "onclick=" to execute the statement. "Processing"/>)
Typically used for the following controls:
Button Buttons Object
CheckBox checkbox or Check List--with the onclick click event, usually for the full selection effect
Radio radio button
Reset Reset button
Submit Submission Button
2, Content Change event onchange such as: (<input type= "text" onchange= "trigger content"/>)
Typically used for
Text input box--with onchange, can achieve the effect of registration detection
TextArea text field
3, select the event onselect --When text or textarea content is highlighted to trigger the event
4. Get Focus Event onfocus -occurs when the object gets focus
5, loss of focus event OnBlur -and to get focus on the event corresponds!
6, the document loading event onload -When the document is loaded is the trigger event. Usually called load events (plus carriage) is generally used to set cookies.
7. Unload Document Event onunload --and load document event corresponding. Occurs when a Web page exits, usually updating the value of a cookie
8, the right mouse button menu function event oncontextmenu --can be shielded when the right mouse button use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.