Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

Knowledge base — HTML

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 397

HTML

onmouseup — handling mouse button release

The global HTML attribute onmouseup contains JavaScript code that handles the mouseup event, associated with releasing a mouse button.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onoffline — handling the offline transition event

The onoffline attribute on body sets a handler for the Window object's offline event. It lets a page react when the browser reports lost connectivity, but does not check whether a particular server is reachable.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

ononline — handling the online event

The ononline attribute on body specifies JavaScript that handles the Window object's online event. It signals a change in the browser's assessment of network availability, but does not confirm that a particular server is reachable.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onpagehide — handling page departure

The onpagehide attribute on body registers a handler for the Window object's pagehide event. In a browser-generated event, event.persisted set to true indicates an intent to retain the document for possible reuse, not that it is actually retained.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onpagereveal — handling page reveal

The onpagereveal attribute on body sets the handler for the Window object's pagereveal event. The event occurs when the document begins rendering after initialization or reactivation.

Intermediate · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onpageshow — handling page display

The onpageshow attribute on body assigns JavaScript code to the Window object's pageshow event. It handles both showing a newly loaded document and showing a preserved document again during history navigation.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onpageswap — handling an outgoing document during navigation

The onpageswap attribute on body sets the Window handler for the pageswap event. This event concerns the outgoing document during navigation; it is not a notification that a new page has appeared.

Intermediate · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onpaste — paste event handler

The onpaste attribute assigns JavaScript code to handle the paste event. It is available on all HTML elements, but adding it does not make an element editable.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onpause — media pause event handler

The onpause attribute contains JavaScript that handles the pause event, usually on an audio or video element. It reacts to playback being paused but does not itself pause playback.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onplay — handling the play event

The onplay attribute contains JavaScript executed for the play event, typically on an audio or video element. This event signals leaving the paused state, not a guarantee that sound or video is already playing.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onplaying — handling readiness to play

The onplaying attribute contains code that handles the playing event, used by audio and video when playback is ready to start or resume after an interruption. It does not start playback and is not equivalent to onplay.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onpopstate — handling changes to the active history entry

The onpopstate attribute on body sets the Window object's popstate event handler. It lets a page respond to session history traversal, such as Back and Forward navigation, and read the destination entry's state.

Intermediate · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onprogress — handling download progress events

The onprogress attribute contains JavaScript that handles the progress event. For audio and video elements, it concerns media data downloading, not the passage of playback time.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onratechange — handling playback-rate changes

The onratechange attribute specifies JavaScript that handles the ratechange event, fired after a media element's playbackRate or defaultPlaybackRate changes.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onrejectionhandled — handling a Promise rejection later

The body attribute onrejectionhandled registers a handler for the Window rejectionhandled event: a previously unhandled Promise rejection has subsequently acquired a handler.

Intermediate · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onreset — handling form resets

The onreset attribute contains JavaScript that handles a form's reset event. The handler runs before default values are restored and can cancel the reset.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onresize — resize event handler attribute

The onresize attribute contains JavaScript that handles a resize event. On the body element, it targets Window rather than changes to the size of the body element itself.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onscroll — handling scrolling events

The onscroll attribute contains JavaScript executed when a scroll event is received. It lets an element react to scrolling, but does not itself create a scrollable area.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onscrollend — handling the end of scrolling

The onscrollend attribute assigns JavaScript code to the scrollend event, which signals that scrolling has finished. Distinguish the attribute name from the event name used with addEventListener().

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onsecuritypolicyviolation — handling CSP violation events

The onsecuritypolicyviolation attribute specifies JavaScript that handles the securitypolicyviolation event associated with a Content Security Policy (CSP) violation. It does not establish a security policy, and CSP can block its inline code.

Intermediate · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onseeked — handling completed media seeking

The onseeked attribute specifies JavaScript to run for the seeked event. On audio and video elements, this event signals that a seek has completed, not that media playback has ended.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onseeking — handle the start of media seeking

`onseeking` specifies code that handles the `seeking` event. The event signals the start of a seek operation in audio or video, even if the playback position stays the same. It does not signal completion.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onselect — handling text selection

The onselect attribute defines JavaScript that runs when a select event occurs, typically when text is selected in an input or textarea control. It does not detect option selection in a select element.

Basic · WHATWG HTML Living Standard; index snapshot date recorded separately
HTML

onslotchange — handling the slotchange event

onslotchange specifies a handler for the slotchange event. In Shadow DOM, this event can fire when a slot’s assigned nodes change or when a direct child is added to or removed from a slot with no assigned nodes.

Intermediate · WHATWG HTML Living Standard; index snapshot date recorded separately