<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Document</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>This is a paragraph.</p>
</body>
</html>Anatomy of the DOM / notebook
Anatomy of the DOM
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
<p class="note" id="intro">This is a paragraph.</p><div>Hello, <span>world</span>!</div><text>Some text</text>
<style><![CDATA[h1 { color: red; }]]></style><!-- This is a comment --><p class="note" id="intro">This is a paragraph.</p>if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_PRECEDING) {
// a precedes b
}