html event attributes include: onblur, onerror, onfocus, onsubmit, onkeydown, onkeypress, onclick, ondblclick, onmousedown, onmousemove, onmouseout, etc.
HTML Event Properties
Window Event Properties
Events triggered for the window object.
Applies to
Tags:Value | Description | |
---|---|---|
script | #Run the script after printing the document||
script | Run the script before the document prints||
script | Run the script before the document loads||
script | Run the script when the window loses focus||
script | Run the script when an error occurs||
script | Run script when window gets focus||
script | Run script when document changes||
script | Run script when document loads||
script | Run script when message is triggered||
#script | Run script when document is offline||
script | Run script when document goes online||
script | When window is hidden Run script||
script | Run script when window is visible||
script | Run script when window history changes||
script | Run the script when the document performs a redo operation||
script | Run script when window is resized||
script | When Web Storage area is updated Run the script when (when the data in the storage space changes)||
script | When the document performs undo Run the script||
script | Run the script when the user leaves the document
Form events
Events triggered by actions inside HTML forms. Applies to all HTML 5 elements, but is most commonly used in form elements:Value | Description | |
---|---|---|
script | Run script when element loses focus||
script | Run script when element changes||
script | Run script when context menu is triggered||
script | When Run script when element gets focus||
script | Run script when form changes||
script | Script that runs when the form gets user input||
script | Run script when element gets user input||
script | Run script when element is invalid||
script | Run when form resets script.HTML 5 is not supported. | |
script | Run script when an element is selected||
script | Run script when form is submitted
Keyboard events
Events triggered by the keyboard. Applies to all HTML 5 elements:Value | Description | |
---|---|---|
script | Run script when key is pressed||
script | Run script when key is pressed and released||
script | Run script when key is released
Attributes | Value | Description |
---|---|---|
onclick | script | Run script when mouse click |
ondblclick | script | Run the script when the mouse is double-clicked |
ondrag | script | Run script when dragging element |
ondragend | script | Run script when drag operation ends |
ondragenter | script | Script that runs when an element is dragged to a valid drop target |
ondragleave | #script | Script that runs when an element leaves a valid drag and drop target |
script | Run script when an element is dragged over a valid drag and drop target||
script | Run script when drag operation starts||
script | Run script when the dragged element is being dragged||
script | When Run script when mouse button is pressed||
script | Run script when mouse pointer moves||
script | Run script when the mouse pointer moves out of an element||
script | Run script when mouse pointer moves over element | |
script | Run script when mouse button is released | |
script | Run the script when the mouse wheel is turned | |
script | Run the script when the scroll bar of the element is scrolled |
Attribute | Value | Description |
---|---|---|
onabort | script | When an abort event occurs Run the script |
oncanplay | script | Run the script when the media is able to start playing but may need to be stopped due to buffering |
oncanplaythrough | script | Run script when the media is able to play to the end without stopping due to buffering |
ondurationchange | #script | Run script when media length changes |
onemptied | script | Run the script when the media resource element is suddenly empty (network error, loading error, etc.) |
onended | #script | Run script when the medium has reached the end |
onerror | script | Run script when an error occurs during element loading |
onloadeddata | script | Run script when media data is loaded |
onloadedmetadata | script | When the duration of the media element and other media data have been Run script on load |
onloadstart | script | Run script when browser starts loading media data |
onpause | script | Run script when media data is paused |
onplay | script | #Run script when media data is about to start playing |
onplaying | script | Run script when media data has started playing |
onprogress | script | When Run the script when the browser is fetching the media data |
onratechange | script | Run when the playback rate of the media data changes Script |
onreadystatechange | script | Run script when ready-state changes |
onseeked | #script | Script run when the media element's positioning attribute[1] is no longer true and positioning has ended |
onseeking | #script | Run script when the media element's positioning attribute is true and positioning has begun |
onstalled | script | Run script when there is an error (delay) in retrieving media data |
onsuspend | script | Run script when the browser is already retrieving media data but stops before retrieving the entire media file |
ontimeupdate | script | Script that runs when the media changes its playback position |
onvolumechange | script | Run script when the media changes volume or when the volume is set to mute |
onwaiting | script | Run script when media has stopped playing but is intended to continue playing |
Other events
Attributes | Value | Description |
---|---|---|
onshow | script | Fired when the |
ontoggle | script | Triggered when the user opens or closes the element
|
For more programming-related knowledge, please visit: Programming Course! !
The above is the detailed content of What event attributes does HTML have?. For more information, please follow other related articles on the PHP Chinese website!

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The role of HTML is to define the structure and content of a web page through tags and attributes. 1. HTML organizes content through tags such as , making it easy to read and understand. 2. Use semantic tags such as, etc. to enhance accessibility and SEO. 3. Optimizing HTML code can improve web page loading speed and user experience.

HTMLisaspecifictypeofcodefocusedonstructuringwebcontent,while"code"broadlyincludeslanguageslikeJavaScriptandPythonforfunctionality.1)HTMLdefineswebpagestructureusingtags.2)"Code"encompassesawiderrangeoflanguagesforlogicandinteract

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful 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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

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

Atom editor mac version download
The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.