Chapter 9. The DOM and jQuery

So far, we’ve been using JavaScript to do relatively simple things like print text to the browser console or display an alert or prompt dialog. But you can also use JavaScript to manipulate (control or modify) and interact with the HTML you write in web pages. In this chapter, we’ll discuss two tools that will allow you to write much more powerful JavaScript: the DOM and jQuery.

The DOM, or document object model, is what allows JavaScript to access the content of a web page. Web browsers use the DOM to keep track of the elements on a page (such as paragraphs, headings, and other HTML elements), and JavaScript can manipulate DOM elements in various ways. For example, you’ll soon see how you can use JavaScript to replace ...

Get JavaScript for Kids now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.