The DOM API provides several methods that allow us to access any element on a page.
These methods will return a node object or a node list, which is an array-like object. These
objects can then be assigned to a variable and be inspected or modified.
For example, we can access the body element of a web page and assign it to the variable
body using the following code:
body = document.body;
Now that we have a reference to the body element, we can check its type:
This is a special Node object with a number of properties and methods that we can use to
find information about, or modify, the body element.
For example, we can use the nodeType property to find out what type of node it is:
All nodes have a numerical code to signify what type they are. These are summarised in the
Search WWH ::