From the course: JavaScript: Enhancing the DOM
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
What is the DOM?
From the course: JavaScript: Enhancing the DOM
What is the DOM?
- [Instructor] Let's start with the most fundamental concept of this course, and probably also in front-end web development, the DOM. DOM stands for document object model. Trust me when I say that the DOM is a crucial concept. After this module, you'll understand that it forms the backbone of any web applications interaction with JavaScript. So how can you visualize a DOM? It helps to think of a webpage as a tree, where each branch and leaf represent different parts of the page, like text, images, or buttons. The DOM is this tree structure the JavaScript uses to interact with the webpage. It represents the page so that programs can change the document structure, style, and content. Now let's look at a basic HTML page. It's just a very simple HTML page with a heading, a paragraph, and an image. When this page is loaded in a browser, the browser creates the DOM automatically. Looking at this page like a tree, it would look something like this. Here, the HTML tag is the root of the tree.…