JS Trigger Event List

Source: Internet
Author: User
Tags key requires return valid window
This article 16 JavaScript triggers events, collected to facilitate everyone to query.

1. Click event ___onclick
The event that occurs when the user clicks the mouse button. The event handler or code specified by the onclick is invoked to execute.
such as: <input type= "button" value= "open page" onlick= "window.open (' xxxx.html ', ' newwindow ', ' width=456,height=230,toolbar= No,menubar=no,scrollbars=yes '); " >

2. Change Event ___onchange
Occurs when the character value within the text or TEXTAREA element changes or the Select table option state changes.
For example, <textarea name= "Liuyan" rows=5 cols=70 value= "Onchange=alert (" you added new content in the text box ") >

3. Select Event ____onselect
This event is raised when the text in the text or TextArea object is selected
such as: <ipnut type= "text" value= "Default Information" Onselect=alert ("You have selected text in TextBox") >

4. Get Focus Event ____onfocus
The event occurs when the user clicks the text or textarea and the Select object, which is when the cursor falls in a TextBox or selection box.
such as: <select name= "Zhengjian" onfocus= "alert (" I become the Focus ") >

5. Loss of focus events ______onblur
Losing the focus event is exactly the opposite of getting the focus event, which is raised when the text object, the TextArea object, or the Select object no longer has the focus and exits the background.

6. Loading File Event ____onload
When the paging file is loaded, produces the event. One of the effects of onload is to detect the value of a cookie at the first load of a paging file, and assign it to a variable to be used by the source code, which is the event of window, but when the event handler is specified in HTML, It is generally written in the <body> tag.
such as: <body onload=alert ("Loading page, please wait ...") >

7. Uninstall File Event ____onunload
In contrast to the load file event onload, the event that is raised when the Web page exits, and the status of the cookie can be updated
such as: <body onunload= "Confirm (" Are you sure you want to leave this page? ") >

8. Mouse Overlay Event _____onmouseover
onMouseOver is the event that is raised when the mouse is over the element
such as: <input type= "Boutton" value= "button" onmouseover= "window.status=" Please note the following status bar '; return True ' >

9. Mouse Left Event _____onmouseout
onMouseOut is the event that is raised by the mouse leaving element. You can create the effect of a dynamic button if you use it in conjunction with the mouse overlay event.

10. General Events
Ondbclick Mouse Double-click event
Events activated when the key on the mouse is pressed
Events triggered when you release the mouse when the mouse is pressed
The event that is triggered in the mouse movement.
onkeypress an event that triggers when a key on the keyboard is pressed and released, requires an active object within the page
OnKeyDown an event that triggers when a key on the keyboard is pressed, requires that an active object be in the page
OnKeyUp an event that triggers when a key on the keyboard is released, requiring that an active object be on the page

11. Page Related Events
Onabort picture is interrupted by user at download time
onBeforeUnload events that are triggered when the contents of the current page will be changed
OnError to catch the current page for some reason, such as a script error.
Events triggered by the OnMove browser's window being moved
OnResize events that are triggered when the size of the browser is changed
Events that are triggered when the scroll bar position of the Onscroll browser changes
An event that is triggered when a OnStop browser's stop button is pressed or the file being downloaded is interrupted.

12. Forms Related Events
OnReset The event that is triggered when the Reset property in the form is activated.
OnSubmit an event that is triggered when a form is submitted.

13. Scrolling caption Events
Onbounce events that are triggered when the contents of a marquee are moved outside the marquee display range.
OnFinish the event that is triggered when the MARQUEE element completes the content that needs to be displayed.
OnStart The event that is triggered when the marquee element starts to display content.

14. Edit the event.
Onbeforecopy an event that triggers when the current selected content of a page is to be copied to the Clipboard of the viewer's system.
Onbeforeupdate notifies the target object when the viewer pastes the contents of the system Clipboard
OnContextMenu The event that is triggered when the right mouse button appears and the menu is triggered by a keyboard key.
<body oncontentmenu= "return false" > Disable right mouse button
Oncopy events that are triggered when the page is currently selected to be copied
Oncut event that is triggered when the page is currently selected for clipping
Onpaste events that are triggered when content is pasted
Ondrag an event that is triggered when an object is dragged
Ondragend the event that is triggered when the mouse is dragged, that is, the event that is triggered when the mouse key is released.

15. Data binding
Onafterupdate events that are triggered when data is completed by the data source to the object's delivery
Oncellchange events that are triggered when a data source is changed
OnDataAvailable events that are triggered when data receives completion
Ondatasetchanged The event that the data is triggered when the data source is changed.
Ondatasetcomplete The event that is triggered when all valid data for the data source has been read.
Onerrorupdate replaces the onafterupdate event when the data transfer is canceled using the onbeforeupdate Event trigger.
Onrowenter The event that is triggered when data from the current data source changes and there are new valid data.
Onrowexit events that are triggered when data from the current data source is about to change
Onrowsdelete events that are triggered when the current data record is deleted
Onrowsinserted the event that is triggered when the current data source will insert a new data record

16. External Events
Onafterprint events that are triggered when a document is printed
Onbeforeprint events that are triggered when a document is about to be printed
OnHelp The event that is triggered when the viewer presses the F1 key or clicks the Help button in the browser



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.