Each HTML page has a document object.
It can help you find all other elements on the page, it can create new tag-elements, it can write a complete new content.
Here are the methods and properties unique to document, that you will need most. Document is a Node and inherits all Node's methods and attributes. They are not all meaningful.