JavaScriptDedicatedWorkerGlobalScope.postMessage sends data from a dedicated worker to its creator. The recipient reads it through event.data. The method supports structured cloning and optional transfer of object ownership.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptDocument represents a DOM document. The document object lets you find elements, read the document root, and use page properties concerning title, focus, and visibility. It is a web-platform interface, not part of ECMAScript itself.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptDocument.body is a Web API property accessed as document.body. It returns a body element, a legacy frameset element, or null. Assignment replaces the entire element, not just its contents.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptdocument.createDocumentFragment() creates an empty DOM fragment. You can collect nodes in it and then move them into a parent without adding an extra wrapper element.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptdocument.createElement creates a new DOM element with the specified name. It does not automatically insert it into the document.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptdocument.createTextNode(data) creates a Text node containing the supplied content without interpreting it as markup.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptDocument.documentElement returns the document's root element or null. The property is read-only, but the element itself can be modified.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptDOMContentLoaded signals that HTML parsing and deferred script execution have finished. Use it to initialize an interface without waiting for the entire page to load.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptDocumentFragment groups DOM nodes without a wrapper element. Inserting the fragment moves its children and leaves it empty.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptdocument.getElementById(elementId) returns the element with the specified ID or null. Matching is case-sensitive and searches the document’s descendants.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptDocument.hidden is a read-only property indicating whether the browser considers the document hidden. Observe visibilitychange to track changes.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptdocument.querySelector(selectors) finds the first element matching a CSS selector. It returns an element or null; an invalid selector throws an exception.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptFinds elements using CSS selectors and returns a static NodeList, including an empty list when nothing matches.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptDocument.readyState describes the document's loading stage: loading, interactive, or complete. Checking this property helps initialize DOM-related code even when a script loads too late to receive DOMContentLoaded.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptDocument.title reads and sets a document's title. Reading it normalizes ASCII whitespace.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptThe visibilitychange event reports a change in document visibility. Read the current state from document.visibilityState.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptDataCloneError is the name of a DOMException indicating that data cannot be cloned. Learn a typical cause in structuredClone(), how to recognize the error, and why an unsupported value differs from a supported circular reference.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptDOMRect.height is a rectangle's writable vertical dimension. It can be negative and affects the computed top and bottom edges.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScript`DOMRect.top` is a read-only property that returns the coordinate of a rectangle’s top edge. Even with a negative height, floating-point rounding can make the result equal to `y`.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptDOMRect.width is a writable instance property describing a rectangle's width. It holds a floating-point number and permits negative values. Do not confuse it with the read-only DOMRectReadOnly.width property.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptDOMStringList is a list of strings exposed by some Web APIs that you do not modify directly. Its contains() method checks whether a supplied string belongs to the list and returns a boolean. A typical use is checking object store names in IndexedDB.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptDOMTokenList.add() adds tokens, such as classes through element.classList, skipping duplicates and validating arguments.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptDOMTokenList.contains(token) reports whether a list contains the exact token, for example a CSS class in element.classList.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptDOMTokenList represents a set of tokens, such as an element's classes exposed through classList. Learn to add, remove, toggle, and check tokens without manually processing the text of the class 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