# HTMLElement and Node

The word **Node** can be referred back to Telecommunications Networks - *a device such as a computer or switch attached to a computer or telecommunications network, or a point in a network topology where lines intersect or terminate*. From there, it probably arrived in XML to represent any type of entity in a document e.g. a Comment node, a Text node, an Element node etc. Similarly, the representation of HTML DOM has various entities like tags, text content, comments, attributes etc. - all these are called **Nodes**.

With respect to HTML DOM, there are 12 different types of `Nodes`, out of which 5 are deprecated (![](/files/-LES_TqyosbCZYSghiJ1)). `HTMLElement` is a `Node` of type `1 (ELEMENT_NODE)`**.**

![](/files/-LES_Tr-EffJ1UwhZFD7)

To construct these Nodes and build the DOM Tree, the browser implementations have Interfaces. The chain of these interfaces start at `Object` as the root.

![](/files/-LES_Tr1j6k6nSSr4JtO)

Let's take an example to illustrate this.

```
<html>
    <head>
        <title>Document Title</title>
    </head>
    <body>
        <h1>Some heading</h1>
        <hr />
        <p>Paragraph text goes here.</p>
    </body>
</html>
```

In the above DOM structure, `<H1>`is an instance of `HTMLHeadingElement`. The properties available on `<H1>` instance would be inherited in a fashion - `HTMLHeadingElement` << `HTMLElement` << `Element` << `Node` << `EventTarget` << `Object`. For example, the two DOM properties of the `<H1>` element (1) `.childNodes` and (2) `.children` are inherited from `Node`. Another interesting thing about these two similar sounding properties is the difference between their results. The former will list *any* type of `Node` (one text node, in this case) and the later will list `Node`only of type `1 (ELEMENT_NODE)` (none, in this case).

![](/files/-LES_Tr4qK5VLQjNdpd2)

To summarize, every `HTMLElement` is a `Node` but not vice versa. The most common type of `Node` which is not an `HTMLElement` is `TEXT_NODE`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://short-js.webf.zone/dom/htmlelement-and-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
