Home > Article > Web Front-end > js detailed introduction to events
Commonly used events:
1. Mouse events: onClick, onDblClick, onMouseDown, onMouseUp, onMouseOut, onMouseOver
·onClick: Occurs when a page element is clicked, onDblClick: Occurs when double-clicking a page element Occurs when you move into the specified element range and release the pressed left button.
2. Keyboard events: onKeyPress, onKeyDown, onKeyUp.
·onKeyDown, onKeyPress, onKeyUp respectively means that the user presses a key but does not release it. Occurs when the keyboard is clicked, and when the keyboard is pressed and released.
3. Form events: onSubmit, onReset, onChange, onSelect
·onSubmit: Occurs when the user submits the form
·onChange: When the user changes Occurs when a value on the page is selected, such as selecting an item in a drop-down list.
·onReset: Occurs when the form data is reset
·onSelect: Occurs when the user selects text from the text box.
4. Read event:
·OnAbort: The user stops the browser and continues to download the image
·onError: When the browser loads the web page or When an image error occurs
·onLoad: Occurs when an image or page loads
·onResize: Occurs when the browser or frame window is resized
·onUnload: When the user Occurs when leaving the page.
·onFocus: When the object gains focus through user interaction, such as clicking a text box
·onBlur: When the object is no longer the focus. For example, click in the text box and then click outside the text box.
5. Other events:
·onAfterUpdate(IE4): When an element with bundled data on the page completes updating the data source
· onBeforeUpdate(IE4): Occurs when the data in the element changes and is about to lose focus, before the data source is updated
·onBounce(IE4): When the content in the selection box element extends beyond the boundary of the selection box External time
·onHelp: Occurs when the browser's help button is pressed
·onMove(NS4): Occurs when the browser window or frame moves
·onReadyStateChange(IE4 ): Occurs when the state of the specified element is changed
·onRowEnter, onRowExit(IE4): Occurs after the record pointer of the current bundled data source is changed and is about to change respectively
·onScroll(IE4 ): Occurs when the user drags the scroll bar
·onStart: Occurs when the content in the selection box element starts to loop
The above is the detailed content of js detailed introduction to events. For more information, please follow other related articles on the PHP Chinese website!