Dom stands for Document Object Model. When a web page is loaded the browser creates a DOM of the page.
- The browsers creates a JS object out of each HTML tag
- Each tag object has inbuilt properties and methods
- DOM elements are also called nodes
- We represent DOM elements as a family tree
- Each node has ancestors, descendants, a parent, children, siblings etc..
Subscribing handlers to events:
element.innerHTML = some new value here
Executing code after given delay:
element.attributeName = some new value
element.setAttribute(attrName, attrValue) -> write mode
element.getAttribute(attrName) -> read mode
element.removeAttribute(attrName) -> delete mode
element.style.cssPropertyName = a new css value