From the course: D3.js Essential Training for Data Scientists

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Understanding the DOM and the console

Understanding the DOM and the console - D3.js Tutorial

From the course: D3.js Essential Training for Data Scientists

Start my 1-month free trial

Understanding the DOM and the console

- [Instructor] Before you start coding in D3, you need to know how to use the DOM, or Document Object Model. The DOM is nothing to do with D3. It describes all the HTML elements, but checking the DOM becomes an important way to check your D3 code. HTML code is written with HTML tags, as we know. There's an opening tag at the top of the page and a closing tag, which has forward slash, at the bottom of the page. Same for head, same for body. If we create a table element, we have opening and closing tags as well. Then we have five rows, the tr tag, each containing two cells given by the td tag. Note that some elements such as td or cell are within other elements such as tr or row. They are entirely enclosed. That is to say, the opening and closing tag of the td element is within the opening and closing tag of the tr element. Similarly, the tr elements are entirely enclosed within table, and in turn the table element is entirely enclosed within the body tag which is enclosed within the…

Contents