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

Element.replaceChildren() — replacing all children

Element.replaceChildren() replaces an element's children with node and string arguments. Calling it without arguments removes all children.

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

Element.replaceWith — replacing an element

Element.replaceWith replaces an element within its parent with nodes and text. Strings become text rather than HTML markup.

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

Element.setAttribute — setting an attribute

Element.setAttribute takes a name and a value for an attribute on a DOM element. On success, it adds the attribute or replaces its 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

Element.setPointerCapture — capturing a pointer

The setPointerCapture(pointerId) method directs subsequent events for one pointer to a chosen element, even after the pointer leaves its bounds. It supports dragging with a mouse, touch, or pen.

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

ErrorEvent — error description and associated value

ErrorEvent is a Web API interface describing errors in scripts or files. Its message property provides a textual description, while error holds the associated JavaScript value—not necessarily an Error object.

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

Event — the event object

Event represents an event. Its properties describe the event's type, target, and creation time.

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

Event.bubbles — event bubbling

Event.bubbles is a read-only Boolean property indicating whether an event can bubble from its target to its ancestors. A value of false does not disable capturing or handling at the target 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

Event.currentTarget — the object handling an event

Event.currentTarget identifies the object whose listener is currently being invoked. Unlike event.target, it describes where the event is handled, not its target.

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

Event.preventDefault() — canceling the default action

preventDefault() marks an event as canceled to prevent its associated default action. It requires cancelable: true and does not work inside a passive listener.

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

Event.stopPropagation() — stopping event propagation

stopPropagation() stops further event propagation without canceling the default action or the remaining listeners in the current invocation.

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

EventTarget — receiving and dispatching events

EventTarget is a Web API interface for registering listeners and dispatching events. A standalone instance can be created without a DOM element.

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

Event.target — the event target

Event.target identifies an event's target, not necessarily the object handling its listener. Learn how it differs from Event.currentTarget.

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

EventTarget.addEventListener — registering event listeners

EventTarget.addEventListener registers an event callback. The capture, once, and passive options control invocation and whether the listener can cancel the 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

EventTarget.dispatchEvent(): synchronous event dispatch

dispatchEvent(event) synchronously dispatches an event to a target. Its Boolean result indicates cancellation, not whether listeners exist.

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

EventTarget.removeEventListener — removing event listeners

removeEventListener() removes a listener by matching the event type, callback identity, and capture value on the same target.

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

fetch — asynchronous resource retrieval

fetch() retrieves a resource and returns Promise<Response>. An HTTP error status does not automatically reject the promise; check response.ok.

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

FocusEvent.relatedTarget — the other focus-transition target

FocusEvent.relatedTarget identifies the other object involved in a focus transition: the previous target when gaining focus or the next target when losing it. The property is read-only and may be null.

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

Disabled form controls

Disabled form controls cannot be operated or focused by the user, and their values are not submitted. In JavaScript, the disabled property switches a control's own disabled state, while a containing fieldset can also disable it.

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

FormData — building and inspecting form data

FormData stores ordered name–value pairs, including repeated names. Learn the difference between append() and set(), how to iterate with entries(), and how to send the data using fetch().

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

FormData.get() — read the first value

FormData.get(name) reads the first value with the specified name: a string or File. If no entry exists, it returns null rather than an empty string.

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

GainNode — controlling audio amplitude

GainNode multiplies audio samples by the gain parameter, enabling muting, amplification, and amplitude automation.

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

HTMLElement.onerror — handling the error event

HTMLElement.onerror assigns a handler for an element's error event, such as an image loading failure. It is not a global mechanism for catching JavaScript exceptions.

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

HTMLElement.onload — handling resource loading

HTMLElement.onload is the event-handler property for load. Assign a function to react to an element's resource loading, such as an image. A subsequent assignment replaces the previous function, while null disables that handler.

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

Headers — HTTP headers

Headers stores HTTP headers for Fetch, supporting reading, appending, replacement, deletion, and iteration.

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