What are the DOM events of JavaScript?
js dom events include: abort, afterprint, blur, canplay, change, click, copy, cut, dblclick, drag, drop, ended, error, focus, open, load, play, etc.
The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.
HTML DOM Events
HTML DOM events allow JavaScript to register different event handlers on elements in an HTML document.
Events are often used in conjunction with functions that are not executed until the event occurs (such as when the user clicks a button).
Event | Description |
---|---|
abort | This event occurs when media loading is aborted. |
afterprint | This event occurs when the page starts printing, or when the print dialog box is closed. |
animationend | This event occurs when the CSS animation completes. |
animationiteration | This event occurs when a CSS animation is repeated. |
animationstart | CSS This event occurs when the animation starts. |
beforeprint | This event occurs when the page is about to be printed. |
beforeunload | This event occurs just before the document is unloaded. |
blur | This event occurs when the element loses focus. |
canplay | This event occurs when the browser can start playing media. |
canplaythrough | This event occurs when the browser can play the media without stopping buffering. |
change | This event occurs when the content of the form element, the selected content, or the selected state changes |
click | This event occurs when the user clicks on an element. |
contextmenu | This event occurs when the user right-clicks an element to open the context menu. |
copy | This event occurs when the user copies the content of an element. |
cut | This event occurs when the user cuts the content of an element. |
dblclick | This event occurs when the user double-clicks an element. |
drag | This event occurs when an element is dragged. |
dragend | This event occurs when the user has finished dragging the element. |
dragenter | This event occurs when the dragged element enters the drop target. |
dragleave | This event occurs when the dragged element leaves the drop target. |
dragover | This event occurs when the dragged element is over the drop target. |
dragstart | This event occurs when the user starts dragging an element. |
drop | This event occurs when a dragged element is dropped on the drop target. |
durationchange | This event occurs when the media duration changes. |
#ended | This event occurs when the media reaches the end. |
error | This event occurs when an error occurs while loading an external file. |
focus | This event occurs when an element gains focus. |
focusin | This event occurs when an element is about to gain focus. |
focusout | This event occurs when an element is about to lose focus. |
fullscreenchange | This event occurs when the element is displayed in full screen mode. |
fullscreenerror | This event occurs when the element cannot be displayed in full screen mode. |
hashchange | This event occurs when the anchor portion of the URL changes. |
input | This event occurs when the element gets user input. |
invalid | This event occurs when the element is invalid. |
keydown | This event occurs when the user is pressing a key. |
keypress | This event occurs when the user presses a key. |
keyup | This event occurs when the user releases the key. |
load | This event occurs when the object has been loaded. |
loadeddata | This event occurs after the media data is loaded. |
loadedmetadata | This event occurs when metadata (such as size and duration) is loaded. |
loadstart | This event occurs when the browser starts looking for the specified media. |
message | This event occurs when a message is received through this event source. |
mousedown | This event occurs when the user presses the mouse button on an element. |
mouseenter | This event occurs when the pointer moves over the element. |
mouseleave | This event occurs when the pointer moves out of the element. |
mousemove | This event occurs when the pointer moves over an element. |
mouseout | This event occurs when the user moves the mouse pointer out of an element or its child elements. |
mouseover | This event occurs when the pointer moves over an element or its child elements. |
mouseup | This event occurs when the user releases the mouse button on the element. |
offline | This event occurs when the browser starts working offline. |
online | This event occurs when the browser starts working online. |
open | This event occurs when a connection to the event source is opened. |
pagehide | This event occurs when the user leaves a page to navigate. |
pageshow | This event occurs when the user navigates to a web page. |
paste | This event occurs when the user pastes some content into an element. |
pause | This event occurs when the media is paused by the user or programmatically. |
play | This event occurs when the media has been started or is no longer paused. |
playing | This event occurs when the media is paused or stopped to play after buffering. |
popstate | This event occurs when the window's history changes. |
progress | This event occurs when the browser is in the process of obtaining media data. |
ratechange | This event occurs when the media playback speed changes. |
reset | This event occurs when the form is reset. |
resize | This event occurs when the document view is resized. |
scroll | This event occurs when the scroll bar of the scroll element is scrolled. |
search | This event occurs when the user types in the search field. |
seeked | This event occurs when the user has finished moving/jumping to a new location in the media. |
seeking | This event occurs when the user starts moving/jumping to a new location in the media. |
select | This event occurs after the user selects text (for and |
show | This event occurs when the |
stalled | This event occurs when the browser attempts to obtain media data but the data is not available. |
storage | This event occurs when the Web storage area is updated. |
submit | This event occurs when the form is submitted. |
suspend | This event occurs when the browser intentionally does not obtain media data. |
timeupdate | This event occurs when the playback position changes. |
toggle | This event occurs when the user opens or closes the element. |
touchcancel | This event occurs when the touch is interrupted. |
touchend | This event occurs when the finger is removed from the touch screen. |
touchmove | This event occurs when the finger is dragged on the screen. |
touchstart | This event occurs when a finger is placed on the touch screen. |
transitionend | This event occurs when the CSS transition is complete. |
unload | This event occurs after the page has been unloaded (for ). |
volumechange | This event occurs when the volume of the media has changed. |
waiting | This event occurs when the media has been paused but is expected to resume. |
wheel | This event occurs when the mouse wheel scrolls up or down on an element. |
[Recommended learning: javascript advanced tutorial]
The above is the detailed content of What are the DOM events of JavaScript?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to use WebSocket and JavaScript to implement an online speech recognition system Introduction: With the continuous development of technology, speech recognition technology has become an important part of the field of artificial intelligence. The online speech recognition system based on WebSocket and JavaScript has the characteristics of low latency, real-time and cross-platform, and has become a widely used solution. This article will introduce how to use WebSocket and JavaScript to implement an online speech recognition system.

WebSocket and JavaScript: Key technologies for realizing real-time monitoring systems Introduction: With the rapid development of Internet technology, real-time monitoring systems have been widely used in various fields. One of the key technologies to achieve real-time monitoring is the combination of WebSocket and JavaScript. This article will introduce the application of WebSocket and JavaScript in real-time monitoring systems, give code examples, and explain their implementation principles in detail. 1. WebSocket technology

Introduction to how to use JavaScript and WebSocket to implement a real-time online ordering system: With the popularity of the Internet and the advancement of technology, more and more restaurants have begun to provide online ordering services. In order to implement a real-time online ordering system, we can use JavaScript and WebSocket technology. WebSocket is a full-duplex communication protocol based on the TCP protocol, which can realize real-time two-way communication between the client and the server. In the real-time online ordering system, when the user selects dishes and places an order

How to use WebSocket and JavaScript to implement an online reservation system. In today's digital era, more and more businesses and services need to provide online reservation functions. It is crucial to implement an efficient and real-time online reservation system. This article will introduce how to use WebSocket and JavaScript to implement an online reservation system, and provide specific code examples. 1. What is WebSocket? WebSocket is a full-duplex method on a single TCP connection.

JavaScript and WebSocket: Building an efficient real-time weather forecast system Introduction: Today, the accuracy of weather forecasts is of great significance to daily life and decision-making. As technology develops, we can provide more accurate and reliable weather forecasts by obtaining weather data in real time. In this article, we will learn how to use JavaScript and WebSocket technology to build an efficient real-time weather forecast system. This article will demonstrate the implementation process through specific code examples. We

JavaScript tutorial: How to get HTTP status code, specific code examples are required. Preface: In web development, data interaction with the server is often involved. When communicating with the server, we often need to obtain the returned HTTP status code to determine whether the operation is successful, and perform corresponding processing based on different status codes. This article will teach you how to use JavaScript to obtain HTTP status codes and provide some practical code examples. Using XMLHttpRequest

Introduction to the method of obtaining HTTP status code in JavaScript: In front-end development, we often need to deal with the interaction with the back-end interface, and HTTP status code is a very important part of it. Understanding and obtaining HTTP status codes helps us better handle the data returned by the interface. This article will introduce how to use JavaScript to obtain HTTP status codes and provide specific code examples. 1. What is HTTP status code? HTTP status code means that when the browser initiates a request to the server, the service

jQuery is a popular JavaScript library that can be used to simplify DOM manipulation, event handling, animation effects, etc. In web development, we often encounter situations where we need to change event binding on select elements. This article will introduce how to use jQuery to bind select element change events, and provide specific code examples. First, we need to create a dropdown menu with options using labels:
