My home page

Hello, I am Marijn and this is my home page.

I also wrote a book! Read it here.

"> My home page

My home page

Hello, I am Marijn and this is my home page.

I also wrote a book! Read it here.

"> My home page

My home page

Hello, I am Marijn and this is my home page.

I also wrote a book! Read it here.

">
<!DOCTYPE html>
<html lang="en">
<head>
    <title>My home page</title>
</head>
<body>
    <h1>My home page</h1>
    <p>Hello, I am Marijn and this is my home page.</p>
    <p>I also wrote a book! Read it
    <a href="<http://eloquentjavascript.net>">here</a>.</p>
</body>
</html>

collection of boxes, Nested set of boxes

browser retrieves html text

convert it into model of document structure

draws a page on screen

Screenshot (398).png

Tree Representation

Screenshot (403).png

The read-only Node.nodeType property is an integer that identifies what the node is. It distinguishes different kind of nodes from each other, such as elements, text and comments.

Screenshot (401).png

Code Example:-

document.nodeType === Node.DOCUMENT_NODE; // true
document.doctype.nodeType === Node.DOCUMENT_TYPE_NODE; // true
document.createDocumentFragment().nodeType === Node.DOCUMENT_FRAGMENT_NODE; // true
var p = document.createElement("p");
p.textContent = "Once upon a time…";
p.nodeType === Node.ELEMENT_NODE; // true
p.firstChild.nodeType === Node.TEXT_NODE; // true