Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / JavaScript

Knowledge base — JavaScript

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

Entries: 1003

JavaScript

HTMLIFrameElement: contentWindow and the load event

HTMLIFrameElement represents an embedded frame. Its contentWindow property exposes the frame's window, while load lets you react when loading finishes. Document access depends on the same-origin policy, and load alone does not confirm a successful fetch.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLImageElement.alt — image alternative text

HTMLImageElement.alt reads and sets an image's text replacement. The property reflects the alt attribute; an empty string and a missing attribute do not mean the same thing.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLImageElement: image loading, dimensions, and complete state

HTMLImageElement lets you set an image source and alternative text, handle load and error events, and read natural dimensions. The complete property does not prove success: it is also true for a broken image or an element without a source.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLImageElement.src — image source URL

HTMLImageElement.src reads or sets an image URL. It reflects the src attribute. Reading it returns an absolute URL only if the attribute value parses successfully using the document's base URL. It does not confirm that the image has loaded.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLInputElement.checkValidity() — checking an input's validity

The checkValidity() method checks the constraints of one input and returns a boolean. For an invalid input that participates in validation, it fires invalid but does not itself display an error message.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLInputElement: input type, state, and constraints

Learn six HTMLInputElement properties for choosing an input type, reading checked state, setting constraints, and disabling a control. Distinguish current state from initial attributes and a validation message from the validation result itself.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLInputElement.setCustomValidity — a custom validation error

HTMLInputElement.setCustomValidity sets or clears a form field's custom error. An empty string clears that error without disabling other constraints.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLInputElement.validity — input validity state

HTMLInputElement.validity exposes an input's current constraint-validation state as a ValidityState object. Its flags identify particular problems, while valid indicates that no error flag is set.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLInputElement.value — reading and writing an input value

HTMLInputElement.value reads or sets a value as a string. Its behavior depends on type; for a text input, the current value can differ from the default value.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLInputElement.valueAsNumber — an input's numeric value

Read and write an input's numeric value. Recognize NaN and remember that conversion depends on the input type.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLMediaElement: time, volume, and playback events

HTMLMediaElement supplies the shared API for audio and video elements. Read playback state, change position and muting, and update the interface from events rather than assuming a playback command succeeded immediately.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLMediaElement.pause() — pausing playback

The pause() method pauses an audio or video element without rewinding it. It takes no arguments and returns undefined. The paused state changes synchronously, whereas the pause event is dispatched later.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLMediaElement.play() — starting playback asynchronously

The play() method requests that audio or video playback start or resume. It returns a Promise, so the interface should account for both playback starting and the request being rejected.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLOptionElement — option value

HTMLOptionElement represents an option element. Its value property returns the value of the value attribute if present, or a value derived from the option's text if the attribute is absent. The current selection state does not affect the result.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLProgressElement: task progress with max and value

HTMLProgressElement exposes the max and value properties of a progress element. They describe the total amount of work and the completed portion, while distinguishing known zero progress from a state where the completion level is unknown.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

script defer — deferred script execution

script defer lets an external classic script download alongside HTML parsing. Execution happens after parsing finishes and before the DOMContentLoaded event.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Module scripts: script type=module

Setting `type="module"` marks the script as a module script. Inline code is treated as a JavaScript module. The HTML Standard also allows `src` to reference a WebAssembly entry module, but browser support varies. JavaScript modules support `import` and `export`, run in strict mode automatically, and have their own scope for declarations.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLSelectElement.value — selected option value

HTMLSelectElement.value reads the first selected option's value or changes the selection by matching a value.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLTemplateElement: inert template content

HTMLTemplateElement stores template content in a separate DocumentFragment exposed through content. The content is not rendered inside the template; copy it with document.importNode() and insert it into the document without consuming the original.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLTextAreaElement.selectionEnd — selection end

HTMLTextAreaElement.selectionEnd reads or sets the ending boundary of a textarea selection. It is a zero-based offset measured in UTF-16 code units; the ending position is excluded from the selection.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLTextAreaElement.selectionStart — selection start

HTMLTextAreaElement.selectionStart reads or sets the selection's start in a textarea. Its zero-based offset counts UTF-16 code units rather than visible characters.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

HTMLTextAreaElement.value — current field text

`HTMLTextAreaElement.value` reads or sets a `textarea` element's current text. Assigning to `value` leaves `defaultValue` unchanged, but changing `defaultValue` can affect what `value` returns while the internal dirty value flag is unset.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

IDBCursor — iterating over IndexedDB records

IDBCursor reads IndexedDB records sequentially in key order. A value-bearing cursor exposes cursor.value, while cursor.continue() asynchronously advances to the next record.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

IDBDatabase — an IndexedDB database connection

IDBDatabase represents an open connection to an IndexedDB database. It lets you create stores during schema upgrades, start transactions, and close the connection.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support