Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / Knowledge base

Knowledge base

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

Entries: 5788

HTML

The media attribute — conditional resource applicability

The media attribute contains a media query list that determines when styles apply, a source is considered, or theme-color metadata is used. Its exact behavior depends on the element: link, style, source, or meta.

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

method — form submission method

The method attribute on form selects get, post, or dialog. It determines how form data is submitted, or closes a dialog instead of making a network request.

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

min — lower value bound

The min attribute sets the lower bound for supported input types and for a meter's range. It does not specify a minimum text length.

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

minlength — minimum text length

The minlength attribute sets the minimum length of a nonempty user-entered value in a textarea or supported input field. It does not make the field mandatory; use required for that.

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

multiple — multiple values in a form control

The boolean `multiple` attribute permits multiple options in `select`, multiple addresses in an `email` input, or multiple files in a `file` input. Its presence controls the behavior, not the text of its value.

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

muted — default media muting

The muted boolean attribute specifies default muting for audio and video elements. The defaultMuted property reflects the attribute, whereas muted reads and changes current muting.

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

HTML name attribute — element-specific meaning

The `name` attribute supplies an element-specific name: a form-data key, navigation target name, image-map name, `details` group, slot name, or metadata name. It is not a global attribute or a replacement for `id`.

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

nomodule — a classic script for browsers without modules

The boolean `nomodule` attribute on `script` prevents a classic script from executing in browsers that support both JavaScript modules and the attribute. It lets you supply a legacy version of your code alongside a module script.

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

The nonce attribute

The nonce attribute holds a textual cryptographic value used by Content Security Policy (CSP). The element.nonce property exposes it to scripts even when the browser hides the attribute value.

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

novalidate — skipping validation during form submission

The boolean `novalidate` attribute on a `form` skips built-in constraint validation during submission. It does not remove field constraints or disable explicit calls to validation methods.

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

onafterprint — handling the post-print event

The onafterprint attribute on body sets a handler for the Window object's afterprint event. It can restore the interface after the printing procedure, but it does not confirm that the document was printed.

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

onauxclick — auxiliary-button click handler

The onauxclick attribute assigns JavaScript code to the auxclick event, associated with clicking a non-primary pointing-device button. It can be used on all HTML elements.

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

onbeforeinput — handling an event before editing

onbeforeinput is an event-handler attribute for beforeinput, which concerns user editing of data. It lets JavaScript run before a change and cancel the default operation when the event is cancelable.

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

onbeforematch — handle an event before hidden content is revealed

The global onbeforematch attribute contains JavaScript handling the beforematch event. It lets code react before the browser reveals an element with hidden="until-found" during find-in-page or fragment navigation.

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

onbeforeprint — handling the event before printing

The onbeforeprint attribute on body defines JavaScript code that handles the Window object's beforeprint event. It lets you prepare document content before printing; it does not start printing by itself.

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

onbeforetoggle — handle an upcoming state change

The `onbeforetoggle` attribute sets a handler for `beforetoggle`. The event fires before a popover opens but not before every close. It also fires before dialog transitions initiated by methods such as `showModal()` or `close()`. Directly adding or removing a dialog’s `open` attribute does not fire the event. The handler can inspect the previous and intended states and cancel opening.

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

onbeforeunload — handle an event before leaving a page

The onbeforeunload attribute on body sets a handler for the Window object's beforeunload event. It can request a warning before leaving the page, but it guarantees neither a dialog nor cancellation of navigation.

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

onblur — handling loss of focus

The onblur attribute contains JavaScript that runs for the blur event when an element loses focus. It lets you respond to leaving a field regardless of whether the user changed its value.

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

oncancel — handling the cancel event

The oncancel attribute contains code that runs when a cancel event is received. On a dialog element, it lets you respond to a close request and, when the event is cancelable, prevent closing.

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

oncanplay — handling media readiness for playback

The oncanplay attribute contains JavaScript that runs for the canplay event. For audio and video, this signals readiness to start or resume playback, but does not guarantee that the entire resource can play without buffering interruptions.

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

oncanplaythrough — handling estimated media readiness

The oncanplaythrough attribute contains JavaScript that handles the canplaythrough event. For audio and video, this signals an estimated ability to play through to the end without further buffering, not a guarantee of uninterrupted playback.

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

onchange — handling a change event

The onchange attribute contains JavaScript that runs for a change event. For form controls, this represents a committed user change, not necessarily every edit to the value.

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

The onclick attribute

The onclick attribute contains JavaScript that handles a click event. Distinguish it from the element.onclick property.

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

onclose — handling a close event

The onclose attribute contains JavaScript that handles the close event. A typical use is responding when a dialog element closes, for example by reading its returnValue. It is not a mechanism for preventing closure.

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