Let’s look at how to get all parent elements of a specific element.
To get the children of an element, you use the childNodes property of the element.
This snippet gets the parent of an element by using the parentNode property of the element.
To select elements by a given class name, you use the getElementsByClassName() method
Select an element that matches the id using the getElementById() method.
This script allows a user to read a volume of text, without having to scroll the page and without having to load different pages. This makes for easier maintenance as only one page needs to be updated, yet the content is visible to search engines. Very useful for large amounts of text.