© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
M. SimonJavaScript for Web Developershttps://doi.org/10.1007/978-1-4842-9774-2_3

3. Manipulating HTML Elements

Mark Simon1  
(1)
Ivanhoe, VIC, Australia
 

All web pages are written initially in HTML, but this code is only text to begin with. The browser then takes this HTML code, together with any associated CSS, and uses it to generate the visible content of the page.

As the browser loads and implements the HTML, it also creates an internal representation of the document for JavaScript. This is called the Document Object Model, or DOM to its friends. We can use the DOM to manipulate various parts of the web page in JavaScript.

In this chapter, we’re going to ...

Get JavaScript for Web Developers: Understanding the Basics 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.