Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the HTML5 events?

2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

What this article shares with you is about the events of HTML5, which the editor thinks is very practical, so I share it with you to learn. I hope you can get something after reading this article. Without saying much, let's take a look at it.

The following table lists the standard event attributes that can be inserted into HTML 5 elements to define event behavior.

Window event property-Window Event Attributes

Form event-Form Events

Keyboard event-Keybord Events

Mouse event-Mouse Events

Media events-Media Events

Window event Properties

The event triggered by the window object. For labels:

Attribute value describes that onafterprintscript runs the script onbeforeprintscript after printing the document, runs the script onbeforeonloadscript before the document is printed, runs the script onblurscript before the document is loaded, runs the script onerrorscript when the window loses focus when an error occurs, runs the script onfocusscript when the window gets focus, runs the script onhaschangescript when the document changes, runs the script onmessagescript when the document loads, runs the script onofflinescript when the message is triggered, runs the script onofflinescript when the document is offline Script ononlinescript run script onpagehidescript when the document is online, run script onpageshowscript when the window is hidden, run script onpopstatescript when the window history changes, run script onredoscript when the document performs redo, run script onresizescript, run script onstoragescript when the document loads, run script onundoscript when the Web Storage area is updated (when the data in the storage space changes) onunloadscript runs the script when the user leaves the document

Form event

An event triggered by an action within the HTML form. Applies to all HTML 5 elements, but is most commonly used in form elements:

Attribute value describes how onblurscript runs script onchangescript when the element loses focus, script oncontextmenuscript when the element changes, script onfocusscript when the context menu is triggered, script onformchangescript when the element gets focus, script onforminputscript when the form changes, script oninputscript when the form gets user input, script oninvalidscript when the element is invalid, onresetscript runs the script when the form resets. HTML 5 is not supported. Onselectscript runs script when element is selected onsubmitscript runs script when form is submitted

Keyboard event

An event triggered by the keyboard. Applies to all HTML 5 elements:

Property values describe onkeydownscript to run the script when the key is pressed onkeypressscript to run the script when the key is pressed and released onkeyupscript to run the script when the key is released

Mouse event

An event triggered by a mouse or similar user action. Applies to all HTML 5 elements:

Property values describe onclickscript running script ondblclickscript when clicking the mouse, running script ondragscript when double-clicking the mouse, running script ondragendscript when dragging an element, running script ondragenterscript when the drag operation ends, running script ondragleavescript when the element is dragged to a valid drag-and-drop target, running script ondragoverscript when the element is dragged above the valid drag-and-drop target, running script ondragstartscript when the drag operation begins. Script ondropscript run script onmousedownscript when dragged element is being dragged run script onmousemovescript when mouse button is pressed run script onmouseoutscript when mouse pointer moves onmouseoutscript run script onmouseoverscript when mouse pointer moves over element run script onmouseupscript run script onmousewheelscript when mouse button is released run script onscrollscript run script when scrolling element scroll bar run script

Media event

Events triggered by media such as video, images, and audio. Applies to all HTML 5 elements, but is most commonly used in media elements such as audio, embed, img, object, and video:

Property value describes that onabortscript runs script oncanplayscript when the middle finger event occurs, when the media can start to play but may need to be stopped because of buffering, run script ondurationchangescript when the media can stop to the end without buffering, run script onemptiedscript when the media length changes when the media resource element is suddenly empty (network error, ) run script onendedscript when the media has reached the end, run the script onerrorscript when an error occurs during element loading, run the script onloadedmetadatascript when loading the media data, run the script onloadstartscript when the duration of the media element and other media data have been loaded, run the script onpausescript when the browser starts loading the media data, when the media data is paused, run the script onplayscript when the media data will To start the playback, run the script onplayingscript when the media data has started to play, run the script onprogressscript when the browser is fetching the media data, run the script onratechangescript when the playback rate of the media data changes, run the script onreadystatechangescript when the ready state (ready-state) changes, run the script onseekedscript when the positioning attribute of the media element is no longer true and the positioning has ended, run the script onseekingscript when the positioning attribute of the media element is True and when positioning has started, run script onstalledscript when there is an error in the process of retrieving media data (delay), run script onsuspendscript when the browser has fetched media data but stopped before retrieving the entire media file, run script ontimeupdatescript when the media changes its playback position, run script onvolumechangescript when the media changes the volume or when the volume is set to mute when the media has stopped playing but intends to continue Run the script during continued playback [1]: the English translation of the positioning attribute is: seeking attribute.

These are the events of HTML5, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report