d8 2026-11-05
d8 is V8's developer shell for running JavaScript programs and investigating engine behavior. It supplies a small host environment around the engine, with facilities for output, loading files and passing arguments.[ref]
Using d8 in the V8 documentation. Opening description; Print to the command line; Pass flags into JavaScript
For example, a file named
sum.js can contain console.log([1, 2, 3].reduce((a, b) => a + b, 0));. Running d8 sum.js prints 6. The array reduction and addition follow ECMAScript semantics, while console.log is an output facility supplied by the environment.The distinction also appears in arguments. The documentation places arguments after
-- and exposes them through a top-level arguments array. A script that prints arguments[0] can therefore inspect a supplied value. This is a shell convention, not a rule that every JavaScript host passes arguments through that same global object.[ref]Using d8 in the V8 documentation. Pass flags into JavaScript, argument separator and arguments object
d8 also documents
read for reading file content and load for executing another script in the current context. Those host operations are different from merely evaluating an arithmetic expression, even though both are invoked with JavaScript syntax.[ref]Using d8 in the V8 documentation. Read input; Load external scripts
A developer shell is useful for separating an engine computation from a larger application. A web browser additionally supplies document and interaction machinery; the presence of V8 alone does not imply a Document Object Model. When using shell observations as performance evidence, record the engine version, flags, workload and measurement method rather than treating one printed result as a benchmark.
Document Object Model 2026-11-05
The Document Object Model represents a document as a DOM tree of DOM nodes and defines operations for examining and changing that tree. In an HTML document, elements and text are different node kinds. The model gives programs access to document structure independently of how a source file happened to spell that structure.[ref]
DOM Standard by WHATWG. §4, Nodes, node trees and the Node, Document, Element and Text interfaces
For example,
<p>Hello <em>world</em>.</p> creates a paragraph element with a text child, an emphasis element and another text child. The emphasis element itself contains the text world. Looking only for element children would miss the text nodes between and inside those elements.A short JavaScript example constructs a paragraph directly:
The first operation creates an element, assigning
const p = document.createElement("p"); p.textContent = "Hello"; document.body.appendChild(p);The first operation creates an element, assigning
textContent supplies its text, and appending it inserts it into the document. Creating an element alone does not place it on the page.[ref]DOM Standard by WHATWG. Document.createElement; Node.textContent; Node.appendChild and insertion algorithms
The Document Object Model is also different from the geometry computed for display. A CSS declaration can change line wrapping or hide an element without deleting that element from the tree. Conversely, inserting a DOM node can alter the tree before or without making a visible change. Separating document structure from rendered boxes helps explain both programmatic editing and browser layout.
DOM comment node 2026-11-05
A DOM comment node stores comment character data in the Document Object Model. In HTML source, a normal comment can be written as
<!-- note -->; parsing it produces a comment node rather than a DOM element or a DOM text node containing visible words.[ref]DOM Standard by WHATWG. §4.14, Comment interface and character data
[ref]For example,
<p>A<!-- note -->B</p> gives the paragraph three child DOM nodes: a text node containing A, a comment node, and a text node containing B. Its childNodes.length is three, while its element-only children.length is zero. Its textContent is AB: the comment does not contribute to this descendant-text result.[ref]DOM Standard by WHATWG. Node.textContent, descendant text content; ParentNode.children
A traversal over every child can consequently encounter nodes absent from an element-only traversal. A DOM comment node can be inserted, moved or removed while editing the DOM tree, although it produces no ordinary displayed text. Removing the comment in this example leaves two adjacent text nodes; adjacency alone does not merge their object identities.
Comments are not a way to keep information secret from someone receiving a document: their data remains in the supplied source or document model. When generating comments, obey HTML's syntax rather than assuming arbitrary text can always be placed between the delimiters.
DOM node 2026-11-05
A DOM node is an object participating in the node model of the Document Object Model. Documents, DOM elements, DOM text nodes, DOM comment nodes and DOM document fragments are different node kinds. They share operations and relationships defined by the Node interface, while particular kinds expose additional data and constraints.[ref]
DOM Standard by WHATWG. Node interface and node tree definitions
For example, a paragraph element can contain a text node. The paragraph has a tag name and attributes; its text child stores character data. Both are DOM nodes, but an element-specific operation such as setting an attribute is not thereby available on the text node.
Insertion also concerns object identity. Suppose an existing paragraph is a child of element A. Executing
B.appendChild(paragraph) moves that same node under B, removing it from A's child list. It does not automatically make a second paragraph. Cloning is a separate operation, with its own treatment of descendants.[ref]DOM Standard by WHATWG. Node.appendChild, insertion algorithms and Node.cloneNode
A newly created node can exist without being connected to a displayed document. Conversely, a connected node need not produce a visible box: a CSS declaration can suppress its display. A reference to a node therefore identifies a document-model object, not a promise about visibility or a fixed screen position. Reading the node kind and its current tree relationships is the appropriate starting point for manipulation.
DOM tree 2026-11-05
A DOM tree is an ordered parent-child structure of DOM nodes in the Document Object Model. Children have an order, each node has at most one parent in a tree, and following parent relationships cannot form a cycle. A document tree is rooted at a document node; its document element is a different node within that structure.[ref]
DOM Standard by WHATWG. Infrastructure, Trees; Nodes, node trees and document trees
In
<p>Hello <em>world</em>.</p>, the paragraph has three children: a text node containing Hello and a following space, the emphasis element, and a text node containing the period. The emphasis element has its own text child containing world. The word world is therefore a descendant of the paragraph, but not its direct child.That distinction explains selector behavior. A child CSS combinator tests an immediate relationship, while a descendant combinator can follow multiple parent-child steps. Inspecting only element children also gives a different list from inspecting every child node, because DOM text nodes and DOM comment nodes are nodes too.
The DOM tree describes document structure rather than the exact source spelling or the boxes painted on screen. HTML parsing can create structure from omitted tags, and CSS can change rendering without inserting a document child. Attribute data is attached to elements under its specified model; it is not simply another ordinary child in the document's child list.[ref]
DOM Standard by WHATWG. Node tree constraints and Element attributes
ECMAScript 2026-11-05
ECMAScript is the standardized core language underlying JavaScript. It specifies grammar, values, built-in objects and evaluation rules; a JavaScript engine implements those rules within a host environment. A web browser's Document Object Model facilities come from additional platform specifications rather than from the core language alone.[ref]
ECMAScript Language Specification by Ecma International. §§1–2, Scope and Conformance; §4.2, Hosts and Implementations
For example, the language-level computation
const a = {count: 1}; const b = a; b.count += 1; a.count gives 2: the two bindings refer to the same object. Copying the binding into b did not make a separate copy of the object's contents. This computation needs no DOM elements.Contrast
document.createElement("p"). The property access and function-call syntax belong to ECMAScript, but the supplied document object and its element-creation behavior come from the host's Document Object Model. A language expression can be syntactically valid even when an environment has not provided a referenced platform object.[ref]DOM Standard by WHATWG. Document interface, createElement
ECMAScript also defines observable choices such as string concatenation versus numerical addition and the rules for lexical scope. These rules do not require every JavaScript engine to use the same internal representation or execution strategy. Reading a program requires distinguishing specified language behavior from the additional facilities supplied by its host.
HTML 2026-11-05
HTML, short for HyperText Markup Language, is the document language used to structure web pages and applications. An HTML element expresses a role such as a paragraph, heading or emphasized passage. An HTML attribute supplies additional information about an element. A web browser parses the source into a Document Object Model that represents the resulting document structure.[ref]
HTML Standard by WHATWG. Introduction, A quick introduction to HTML, elements, attributes and the document tree
Consider
<p class="warning">Save <em>your work</em>.</p>. The p element contains text and an em element; class="warning" is an attribute on the paragraph. The two elements form a nested structure. A CSS selector such as .warning can match that paragraph, while a CSS declaration chooses a presentation such as a red foreground color.This distinction preserves useful meaning across presentations. A heading or emphasized passage remains structurally identified even if a CSS rule changes its size, color or typeface. The browser's default styling is one rendering of that structure, not the definition of its semantics.[ref]
HTML Standard by WHATWG. Introduction, Presentational markup and the quick HTML example
The serialized source and the live document also need not stay identical after parsing or later changes. In particular, writing text that looks like a start tag inside a quoted source-code example is different from creating an element in the parsed tree. The HTML parser has specified error recovery for malformed input, but that recovery does not make every apparent nesting in a source file a valid document structure.[ref]
HTML attribute 2026-11-05
An HTML attribute supplies information about an HTML element, usually through a name and a value in its start tag. Its meaning is defined for the relevant element and attribute. The source notation is converted into attribute data on the element in the Document Object Model.[ref]
HTML Standard by WHATWG. Introduction, attributes in the quick HTML example; HTML syntax, Attributes
For example,
<p id="notice" class="warning">Save</p> gives the paragraph the identifier notice and the class warning. CSS selectors #notice and .warning can then match it for different reasons. The text Save is element content, rather than another attribute value.Some attributes use presence as their boolean signal. For an applicable HTML boolean attribute,
disabled and disabled="false" both express presence; the latter spelling does not make it false. Removing the attribute expresses absence. Treating every value as a programming-language boolean would therefore misread the document.[ref]HTML Standard by WHATWG. Common microsyntaxes, Boolean attributes: presence/absence and permitted values
Attribute data and live interface properties are related by specified reflection rules, not by a universal identity. For some controls, an attribute describes a default while the current state can change through interaction. A JavaScript property access must consequently be interpreted using that interface's definition. This is particularly useful when debugging why the original source and the state a user sees no longer look identical.
HTML element 2026-11-05
An HTML element is a structural component of an HTML document with a defined name, attributes and semantics. Paragraphs, headings and controls are examples. An HTML tag is source syntax that can identify the start or end of an element; the element itself is the object represented in the parsed Document Object Model.[ref]
In
<p>Hello <em>world</em>.</p>, the paragraph contains an emphasis element as well as text. The word world is inside the emphasis element, while Hello and the final period are other text in the paragraph. These parent-child relationships make the structure useful for navigation, editing and matching CSS selectors.Not every element is written with an explicit start/end pair. For example, the line-break element
br is a void element and has no end tag in HTML syntax. Conversely, two source strings can produce equivalent document structure because parsing accounts for omitted tags and other specified rules. Counting written tags is therefore not a reliable substitute for inspecting elements.[ref]An HTML element's semantic role and its display are connected through browser behavior but remain different descriptions. A paragraph can wrap across several visual lines, and a CSS property can change its appearance without replacing the paragraph element. Choosing structural elements for their meaning allows the same content to remain intelligible under different styles.
HTML tag 2026-11-05
An HTML tag is a piece of source syntax that identifies the start or end of an HTML element. A start tag can contain HTML attributes; an end tag identifies a closing point under the parser's rules. The tag is source notation, while the resulting element is an object in the Document Object Model.[ref]
For example,
<p class="note">Hello</p> contains a paragraph start tag, text content and a paragraph end tag. Parsing it produces one paragraph element, not two elements corresponding to the two tags. Its text is represented separately in a DOM text node.An HTML void element such as
br has no end tag in HTML syntax. Some other elements permit tags to be omitted in specified contexts, so counting start/end pairs is not a complete account of the parsed structure. A trailing slash is also governed by HTML's own rules; it does not generally turn an ordinary HTML element into a self-closing XML-style element.[ref]HTML Standard by WHATWG. Elements, void elements, optional tags and start-tag syntax
HTML void element 2026-11-05
An HTML void element is an HTML element whose HTML syntax permits no contents and no end tag. Examples include
br, img and input. An ordinary element that happens to contain no text does not thereby become void.[ref]For example,
<p>A<br>B</p> contains a paragraph with text A, a line-break element and text B. The br start tag has no matching </br> end tag. An image's source and alternative text likewise use attributes such as src and alt, rather than child text between an image start/end pair.The optional slash in
<br /> does not create the void behavior; br is void because of its element category. The same slash does not make <div /> into a generally self-closing ordinary HTML element. Reading such source requires the HTML parser's rules.[ref]Source conformance and general Document Object Model operations must also be distinguished. A program can construct a node tree that violates an element's HTML content restrictions. Such an object does not make nonconforming source or a void element's hypothetical children a valid way to serialize HTML. The DOM element model and the allowed source syntax answer different questions.
JavaScript 2026-11-05
JavaScript is a general-purpose programming language widely used to implement behavior in web applications. Its core language is standardized by ECMAScript; environments such as a web browser supply additional facilities, including access to the Document Object Model. A language expression and a browser operation consequently need not come from the same specification.[ref]
ECMAScript Language Specification by Ecma International. Overview, Web Scripting and Hosts and Implementations
For example,
const squares = [1, 2, 3].map(x => x * x); produces an array containing 1, 4, 9. The expression supplies a function that the array's map operation applies to each entry. This computation does not require a page or a document tree. A browser expression such as document.createElement("p") instead uses the host's document interface.[ref]ECMAScript Language Specification by Ecma International. Array.prototype.map and arrow-function expressions
[ref]DOM Standard by WHATWG. Document.createElement
Values and conversion rules matter.
1 + 2 evaluates to the number three, while "1" + 2 evaluates to the text "12" because that addition operation performs string concatenation. Reading the exact operand types explains the result more reliably than treating every plus sign as numerical addition.[ref]Lexical scope determines which binding an expression refers to from the surrounding program structure. In an interactive page, the language can use those bindings while reading or changing DOM nodes. Distinguishing the core language, its environment and the program's own data makes examples easier to transfer between browser and nonbrowser implementations.
JavaScript engine 2026-11-05
A JavaScript engine implements the execution of JavaScript programs according to the applicable ECMAScript language rules. It reads program structure and performs the operations that produce values, state changes and errors. The engine is one component of an environment; a web browser additionally supplies document, networking and interaction facilities.[ref]
ECMAScript Language Specification by Ecma International. §§1–2, Scope and Conformance; §4.2, Hosts and Implementations
For example,
function square(n) { return n * n; } square(7); evaluates to 49. An interpreter can execute a representation of these operations, while compilation can translate operations into another executable form. Just-in-time compilation performs compilation during execution rather than requiring a wholly separate advance compilation step. These implementation choices do not change the multiplication result required by the language.A concrete implementation is V8, whose Ignition is documented as a register-based interpreter. Such an implementation can use intermediate bytecode rather than repeatedly treating source text as its direct execution format. This example describes one engine architecture, not a requirement that every JavaScript engine use the same machinery.[ref]
Ignition in the V8 documentation. Opening description and linked interpreter overview
Host facilities must be distinguished from language execution. Evaluating a call involving
document requires the environment to supply that object; implementing ECMAScript alone does not promise the Document Object Model. Conversely, numerical computations need not create any document nodes.Performance comparisons require a specified workload. Parsing, first execution, repeated execution and calls into host facilities can have different costs. Timing only a tiny warmed-up function therefore does not measure every aspect of loading or running an application, even when the returned values are identical.
Markup language 2026-11-05
A markup language describes annotations embedded in or associated with document content. Its syntax distinguishes ordinary content from instructions identifying structure, meaning or presentation. HTML is a concrete example: a paragraph and an emphasized phrase can be represented explicitly instead of inferred from their appearance.[ref]
For example,
<p>Save <em>your work</em>.</p> identifies a paragraph containing an emphasized phrase. The angle-bracketed HTML tags mark elements; the words between them supply content. A web browser can build a Document Object Model from this source, then use CSS to choose its presentation. Changing the emphasis styling need not change which phrase is structurally emphasized.The syntax needs a way to represent its own reserved characters as content. In HTML,
< can represent a literal less-than character in text rather than starting a tag. A document explaining markup therefore needs to distinguish a displayed example from active markup that the parser interprets as document structure.[ref]A markup language is useful when documents must be transformed, searched or rendered according to their structure. It does not follow that every source annotation creates a visible box, or that a visible line break implies a particular structural element. Source syntax, the parsed document and the final rendering are related representations with different jobs.
V8 2026-11-05
V8 is an open-source engine implementing JavaScript through ECMAScript and also executing WebAssembly. It can be embedded in applications, so the engine and the application supplying its environment are distinct components.[ref]
For a simple language-level example,
[1, 2, 3].map(x => x * x) evaluates to an array containing 1, 4, 9. The specified array and multiplication behavior belongs to ECMAScript; V8 supplies an implementation of that behavior. The same expression does not require a document or a web browser.The project's d8 developer shell supplies a small environment for running programs. A file containing
console.log(6 * 7); prints 42 when run in that shell. The multiplication is language behavior, whereas the output facility is supplied by the environment.[ref]Using d8 in the V8 documentation. Print to the command line, JavaScript files and console.log
V8 includes Ignition, a register-based interpreter. Interpreter machinery, bytecode and compilation strategies concern how an engine executes a program, rather than changing the program's specified mathematical result.[ref]
Ignition in the V8 documentation. Opening description, register-based interpreter
An embedding application can supply additional objects and functions. A Document Object Model operation therefore depends on a suitable host, not merely on the presence of V8. Likewise, a performance comparison must name the engine version, workload and measurement conditions rather than treating one fast numerical expression as a measurement of an entire application.
Web browser 2026-11-05
A web browser retrieves and presents web resources while providing an environment for interaction with them. For an HTML page, this includes parsing source into a Document Object Model, applying CSS, laying out the result and rendering it. Programs such as JavaScript can then change the document or respond to user actions.[ref]
HTML Standard by WHATWG. Introduction, web platform scope and quick HTML example; document processing and scripting model
Consider a page containing
<p id="notice">Waiting</p>. Its visible word begins as Waiting. A program can obtain that element and change its text to Ready; the Document Object Model and displayed page then change without requiring the original response bytes to change. The browser maintains a live document and rendering state, rather than repeatedly displaying an immutable picture of the source.The visible area also has several coordinate scales. The layout viewport constrains layout, while the visual viewport describes the portion being viewed. Page zoom, pinch zoom and scrolling can change those relationships. This matters when a program places a label relative to a document element or interprets a pointer position.[ref]
CSSOM View Module by World Wide Web Consortium. Viewports, Zooming and the VisualViewport interface
A URL identifies a resource to navigate to; a web search engine helps discover resources. A browser can present search results as a page, but navigating directly to a known address does not require a search query. The retrieval service and the software interpreting its pages remain separate parts of the system.