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

history.back() — moving backward in session history

history.back() requests traversal one entry backward in browser session history. It behaves like history.go(-1); without a previous entry, it changes nothing.

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

history.forward() — move forward through history

history.forward() moves one entry forward through browser session history. It behaves like history.go(1); without a next entry, it changes nothing.

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

history.go() — traversing session history

history.go(delta) uses an offset measured in session history entries. Web IDL first converts a supplied argument to a signed 32-bit integer (long). A negative result requests backward traversal, a positive result requests forward traversal, and a zero result or an omitted argument reloads the page. Traversal is asynchronous.

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

history.pushState() — a history entry without reloading

history.pushState() normally adds a session history entry, stores state, and optionally changes the URL without loading a new document. Updating the interface remains your responsibility.

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

history.replaceState — update the current history entry

history.replaceState updates the state and optionally the URL of the current history entry without reloading the page. It does not add an entry, so it creates no additional Back-button step.

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

HTMLAnchorElement: href address and target destination

HTMLAnchorElement represents a hyperlink in the browser DOM. Its href property specifies the resource address, while target selects the browsing context in which to open it. Learn how the href property differs from the attribute and what _blank means.

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

HTMLButtonElement.disabled — disabling a button

HTMLButtonElement.disabled is a boolean property reflecting the presence of a button's disabled attribute. It lets you disable a button or remove its own disabled attribute, but does not describe every reason the control may be disabled.

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

HTMLButtonElement.form — the form associated with a button

The read-only HTMLButtonElement.form property returns the HTMLFormElement associated with a button, or null. It identifies the actual form rather than the text value of the form attribute.

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

HTMLButtonElement.type — button action type

HTMLButtonElement.type reads a button's effective type and writes its type attribute. It distinguishes submit, reset, and button; a missing or invalid value does not always mean submit.

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

HTMLCanvasElement: drawing context and dimensions

HTMLCanvasElement provides a browser drawing surface. Learn how to use getContext(), width, and height. With a 2D context, assigning either dimension clears the drawing and resets context state, even when the value does not change.

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

HTMLCollection.length — number of elements in a collection

HTMLCollection.length returns the current number of elements in a DOM collection. It is read-only, and its value updates automatically when the membership of the live collection changes.

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

HTML drag lifecycle events

Learn the seven HTML drag events, how they are divided between source and target, and when DataTransfer is readable or writable. Understand why dragover needs preventDefault() and why dragend does not prove that a drop succeeded.

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

HTMLElement.click — programmatic clicking

HTMLElement.click triggers a synthetic click on an HTML element. It is neither a physical click nor a source of user activation.

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.dataset — accessing data-* attributes

HTMLElement.dataset exposes an element's data-* attributes as a DOMStringMap. It lets you read, write, and delete string data, mapping names such as data-user-id to userId.

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.focus — setting focus programmatically

The focus() method moves focus to an element that can receive it. Learn how focus differs from clicking, how scrolling and focus indication options work, and how to check 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

HTMLElement.hidden — hiding an element

HTMLElement.hidden reflects the hidden attribute: it returns false, true, or "until-found". It is not a visibility test.

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

HTMLElement: visibility, interaction and element height

Learn hidden, draggable, tabIndex, click(), offsetHeight and title on HTMLElement. Distinguish writable properties, an activation method and a read-only measurement while accounting for keyboard navigation and CSS layout.

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.offsetWidth — element layout width

HTMLElement.offsetWidth reads an element's integer width in CSS pixels, including padding and borders but excluding margins. It ignores CSS transforms.

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.style — an element’s inline styles

HTMLElement.style exposes a mutable inline CSS declaration object, not the result of the cascade.

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.tabIndex — focus and navigation order

The tabIndex property reflects the tabindex attribute and influences focusability and keyboard navigation order.

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

HTMLFormElement.checkValidity() — checking form validity

The form.checkValidity() method checks constraints on controls associated with a form and returns a boolean. It neither submits the form nor displays the browser's standard validation messages.

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

HTMLFormElement.reportValidity() — validate a form with user feedback

HTMLFormElement.reportValidity() checks validation constraints on controls associated with a form and can report errors to the user. It returns a boolean and does not itself submit the form.

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

HTMLFormElement.requestSubmit() — submitting a form with validation

requestSubmit() starts the standard form submission procedure, which can include validation and a submit event. An optional button identifies the submitter and can change submission settings. Unlike submit(), this method does not bypass these mechanisms.

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

HTMLFormElement.reset() — restoring a form's default state

HTMLFormElement.reset() restores the default state of controls associated with a form rather than simply emptying them. It first dispatches a cancelable reset event; preventDefault() stops the restoration.

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