What event attributes does HTML have?
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!

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



Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.
