What can I do with the DOM? (Examples)

You can access elements and nodes.

document.getElementById() // returns an element by it's ID
document.getElementsByClassName() // returns a live HTMLCollection (array-like object)
document.getElementsByTagName() // returns a live HTMLCollection
document.getElementsByTagNameNS() // returns a live NodeList
document.querySelector() // returns the **first** element, takes a CSS selector (`.class`, `#id`, `input[type="text"]`) as argument
document.querySelectorAll() // returns a non-live NodeList of all elements
document.getElementsByName() // returns a live NodeList

You can add things to the document

document.createAttribute() // creates and returns an attribute node
document.writeln(line) // writes a string of text followed by newline  
let p = document.createElement('p')

p.innerText = "This is text inside the paragraph element you just created. Hola!"