DOM is the interface responsible for generating the representation of the HTML page to the Browser Agent. This structure can also be used to access objects and its properties through JavaScript.

/* Common Selectors */
document.getElementById([Id]) // Return HTML Element with Id
.getElementsByClass([class]) // Return Array of Elements with class
.getElementsByTag([tag]) // Return Array of Elements with tag
.querySelector([selector]) // Return NodeList of Element with #Id, .class or tag
.querySelectorAll([selector]) // Return NodeList with .children Array of Elements
/* Common Element Manipulation */
const Element = document.getElementById('header')
Element.style.[cssProperty] = [value] //Change CSS Property of element
Element.innerHTML = [value] //Change Exact value of **inner <tag> content**
var innerText = Element.innerText // Return just inner text, excluding inner tags
const element = document.getElementById('divExample')
/* Hierarchy Access */
element.parentNode //Return above element in the HTML hierarchy
element.parentElement //Return only the above element, not inner elements
element.children //Return HTMLCollection of below elements
element.firstChild //Only first child
element.lastChild //Only last child
/* Create Elements */
let div = document.createElement('div') //Create an element with any tag
div.id = 'tst'
document.body.appendChild(div) //Append element as child of any tag
/* Modify Elements */
element.id = [id] //Set id to element
element.className = [className] //Set class to element
element.classList.add([className), [...]) //Add class to element
element.classList.remove([className], [...]) //Remove class from element