JavaScript Event Logging usage Instructions _javascript tips

Source: Internet
Author: User

An event in JavaScript is a basic operation that responds to the user, and is an action that can be detected by JavaScript. Each element of a Web page can produce certain events that can trigger JavaScript functions.

JavaScript List of events (event properties-occurrence conditions):

onabort– the loading of a picture is terminated (only for )
onblur– when an element loses focus (the cursor moves away)
onchange– user changed the value of a field (for <input type= "text", <select>, <textarea>)
onclick– Mouse Click Object
ondblclick– mouse Double click Object
onerror– file or picture loading error (&LT;IMG&GT;, <object>, <style>)
onfocus– an element to get focus
onkeydown– keyboard One key is pressed
onkeypress-Keyboard One key is pressed or kept pressed
onkeyup– when the pressed key is released
onload– when a page or picture finishes loading
onmousedown– When a mouse button is pressed
OnMouseMove-Mouse Move
onmouseout– Mouse is removed from an element
onmouseover– the mouse to an element
onmouseup– mouse button is released
onreset– reset button is clicked
onresize– window or frame size changed
onselect– text is selected
onsubmit– Submit button is clicked
onunload– User Closes page
OnLoad and OnUnload

The onload and OnUnload events are triggered when the user enters or leaves the page.

The onload event is typically used to check the browser type and version of the visitor and to load the appropriate version of the Web page based on that information.

OnLoad and OnUnload events are also often used to set cookies when a user enters or leaves a page.

Onfocus, OnBlur and OnChange.

Onfocus, OnBlur and OnChange events are often used in conjunction with validation of form fields.

OnSubmit

OnSubmit events are often used to validate all field values before the form is submitted

OnMouseOver and onmouseout
OnMouseOver and onmouseout are often used to generate animated buttons.

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.