Problem Domain, Objects, and the DOM
Objects
An object is a grouped variables and functions that are used to create a model to represent something in the real world. An object has property and method. We can access an object using dot notation.
Document Object Model
The Document Object Model defines how browsers should create a model of an HTML page and how JavaScript can access and update the contents of a web page while it is in the browser window.
- the browser represents the page using a DOM tree
- DOM trees have four types of nodes
- document nodes
- element nodes
- attribute nodes
- text nodes
- using id, class attributes, tag name, or CSS selector syntax to select element nodes
- if a DOM query returns more than one node, it will return a NodeList
- an element node can contain multiple text nodes and child elements
- browser offers tools for viewing the DOM tree