HTML EVENT ATTRIBUTES LIST
These events can be triggered by various interactions performed by the user or the browser itself.
When an event occurs, it can be handled using JavaScript, which enables dynamic and interactive behavior on web pages.
Attributes
Description
onabort
Triggered when an image, audio, or video is aborted while loading.
onafterprint
Fired after the user prints a page.
onbeforeprint
Fired before the user prints a page.
onbeforeunload
Fired before the user navigates away from the page.
onblur
Fired when an element loses focus.
oncanplay
Fired when media can start playing.
oncanplaythrough
Fired when media can be played through without stopping for buffering.
onchange
Fired when the value of an input element is changed.
onclick
Fired when an element is clicked.
oncontextmenu
Fired when the user right-clicks on an element to open the context menu.
oncopy
Fired when the user copies content from an element.
oncut
Fired when the user cuts content from an element.
ondblclick
Fired when an element is double-clicked.
ondrag
Fired when an element is dragged.
ondragend
Fired at the end of a drag operation.
ondragenter
Fired when a dragged element enters a drop target.
ondragleave
Fired when a dragged element leaves a drop target.
ondragover
Fired when an element is being dragged over a drop target.
ondragstart
Fired when the user starts dragging an element.
ondrop
Fired when a dragged element is dropped on a drop target.
ondurationchange
Fired when the duration of media is changed.
onended
Fired when media has reached the end.
onerror
Fired when an error occurs while loading an external resource.
onfocus
Fired when an element receives focus.
onhashchange
Fired when the URL hash (fragment identifier) changes.
oninput
Fired when the value of an input element is changed (including keyboard input).
oninvalid
Fired when a form element is invalid.
onkeydown
Fired when a key is pressed down.
onkeypress
Fired when a key is pressed and released.
onkeyup
Fired when a key is released.
onload
Fired when an external resource (e.g., image, script, style) finishes loading.
onloadeddata
Fired when media data is loaded.
onloadedmetadata
Fired when metadata for media (e.g., duration) is loaded.
onloadstart
Fired when the browser starts to load an external resource.
onmousedown
Fired when a mouse button is pressed down over an element.
onmouseenter
Fired when the mouse pointer enters an element.
onmouseleave
Fired when the mouse pointer leaves an element.
onmousemove
Fired when the mouse pointer is moved over an element.
onmouseout
Fired when the mouse pointer leaves an element.
onmouseover
Fired when the mouse pointer is moved onto an element.
onmouseup
Fired when a mouse button is released over an element.
onmousewheel
Fired when the mouse wheel is rotated (deprecated; use 'onwheel' instead).
onoffline
Fired when the browser is offline.
ononline
Fired when the browser is online.
onpagehide
Fired when the user navigates away from a page.
onpageshow
Fired when the user navigates to a page.
onpaste
Fired when the user pastes content into an element.
onpause
Fired when media playback is paused.
onplay
Fired when media playback is started or resumed.
onplaying
Fired when media playback starts after a delay.
onpopstate
Fired when the user navigates backward or forward through the history.
onprogress
Fired periodically as media loads.
onratechange
Fired when the playback rate of media is changed.
onresize
Fired when the browser window or an element is resized.
onscroll
Fired when an element's scrollbar is scrolled.
onsearch
Fired when the user submits a search in a search input field.
onseeked
Fired when media seeking is completed.
onseeking
Fired when media seeking is started.
onselect
Fired when the user selects text in an element.
onshow
Fired when a 'details' element is shown.
onstalled
Fired when media playback is stalled due to buffering.
onsubmit
Fired when a form is submitted.
onsuspend
Fired when media data loading is suspended.
ontimeupdate
Fired when the playback position of media is changed.
ontoggle
Fired when the user opens or closes a 'details' element.
ontouchcancel
Fired when a touch event is interrupted or canceled.
ontouchend
Fired when a touch point is removed from the touch surface.
ontouchmove
Fired when a touch point is moved along the touch surface.
ontouchstart
Fired when a touch point is placed on the touch surface.
onunload
Fired when the user navigates away from a page.
onvolumechange
Fired when the volume of media is changed.
onwaiting
Fired when media playback is waiting due to buffering.