The Document Object Model (DOM)

The Document Object Model (DOM) is the API exposed by the browser to allow JavaScript to communicate with HTML and, indirectly, CSS. Since one of JavaScript's main abilities is dynamically changing content on a page, we should know how to do that. Enter the DOM.

In this chapter, we will learn how to use this powerful API to read and change content on a page. I'm sure you've seen websites that change content without reloading the page. These programs use DOM manipulation, and we'll learn how to use it. 

The following topics will be covered in this chapter:

  • Selectors
  • Properties
  • Manipulations

Technical requirements

Be sure to have the https://github.com/PacktPublishing/Hands-on-JavaScript-for-Python-Developers ...

Get Hands-on JavaScript for Python Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.