Home >Web Front-end >JS Tutorial >What are the JavaScript events?

What are the JavaScript events?

coldplay.xixi
coldplay.xixiOriginal
2021-03-31 11:38:075952browse

Javascript events include: 1. onLoad is triggered when the page is loaded and is often used for the body element; 2. onUnload is triggered when the page is closed and is often used for the body element; 3. onMouseOver is triggered when the mouse is hovering; 4. onMouseOut is triggered when the mouse leaves.

What are the JavaScript events?

The operating environment of this tutorial: Windows 7 system, JavaScript version 1.8.5, DELL G3 computer.

javascript events include:

What are javascript events?

JavaScript gives us the ability to create dynamic pages. Events are behaviors that can be detected by JavaScript. Every element in a web page can generate certain events that trigger JavaScript functions. For example, we can generate an onClick event to trigger a function when the user clicks a button.

What are the commonly used events in javascript?

1. onLoad: triggered when the page is loaded, often used in the body element

2. onUnload: triggered after the page is closed, often used in the body element

3. onBlur: triggered when focus is lost, often used for input form elements

4. onFocus: triggered when focus is obtained, often used for input form elements

5. onClick: triggered when clicked , can be used for any element

6, onMouseOver: Triggered when the mouse hovers

7, onMouseOut: Triggered when the mouse leaves

8, onMouseDown: Triggered when the mouse is pressed Triggered when

9, onMouseUp: Triggered when the mouse bounces up

10, onMouseMove: Triggered when the mouse moves

11, onChange: Triggered when the status changes, commonly used In select drop-down box

12, onSelect: Triggered when the text in the text box is selected

13, onkeypress: Triggered when the keyboard is pressed (faster than onkeydown)

14. onkeydown: Triggered when the keyboard is pressed (possibly capturing function keys, such as up, down, left, and right)

15. onkeyup: Triggered when the keyboard pops up

16. onSubmit: When the form Triggered when submitted, often used in form form elements

17, onReset: Triggered when the form is reset, often used in form form elements

Related free learning recommendations: javascript video Tutorial

The above is the detailed content of What are the JavaScript events?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn