From the course: Web Programming Foundations
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
The Document Object Model (DOM)
From the course: Web Programming Foundations
The Document Object Model (DOM)
- [Instructor] Any time we're talking about the content that's being rendered in the browser, we are talking about the DOM, the Document Object Model. The DOM is the browser's model for the document displayed. In HTML, every piece of content is wrapped in a beginning and an end tag, creating an HTML element. Each of these elements is a DOM object, typically referred to as a node. And the browser handles each of them as an independent object. That's why when you target something with a CSS rule, say, all anchor tags within a document, that rule is applied to each item independently. When you write a CSS rule targeting the element a, what you're saying is find me every a node and apply the following style property settings to it. When a document is loaded in the browser, a Document Object Model is created for just this document instance. The browser now creates a node tree, modeling the relationships between the different…