Chapter 24. Working with the DOM and Events
24
Working with the DOM and Events
by Aaron Gustafson
In This Chapter
Progressive enhancement for JavaScript
An introduction to the DOM
Working with element, text, and attribute nodes
JavaScript events
Ensuring accessibility
Over the course of the last two chapters, you learned about a bunch of fundamental JavaScript concepts that serve as the foundation for working with this programming language. This chapter builds on that foundation to give you the skills to do what web developers—like you—are tasked with every day: enabling rich interactions with our web pages.
As we progress through this chapter, we’ll be looking at a handful of JavaScript techniques that relate to creating interactive user interfaces, including:
- How to generate new markup and change existing HTML by using JavaScript with the DOM
- How to use JavaScript events that respond to user interactions
- How to ensure your code provides accessible experiences
See the sidebar “The Plan: Build a Theme Toggle” for how this will all come together.
I’ll kick off the chapter with a refresher on progressive enhancement, a programming philosophy you met back in Chapter 3, Some Big Concepts You Need to Know, that will help you make better choices when it comes to designing and building JavaScript-driven user experiences.
This will be a gentle introduction to a more challenging chapter than the previous two. I’m going to be throwing a lot of new syntax and concepts at you, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access