Skip to Main Content
Head First JavaScript Programming, 2nd Edition
book

Head First JavaScript Programming, 2nd Edition

by Eric Freeman, Elisabeth Robson
August 2024
Beginner content levelBeginner
662 pages
17h 50m
English
O'Reilly Media, Inc.
Content preview from Head First JavaScript Programming, 2nd Edition

Chapter 6. Interacting with your web page: Getting to know the DOM

Image

You’ve come a long way with JavaScript. In fact, you’ve evolved from a newbie to a scripter to, well, a programmer. But, there’s something missing. To really begin leveraging your JavaScript skills, you need to know how to interact with the web page your code lives in. Only by doing that are you going to be able to write pages that are dynamic, pages that react, that respond, that update themselves after they’ve been loaded. So how do you interact with the page? By using the DOM, otherwise known as the document object model. In this chapter, we’re going to break down the DOM and show you how you can use it, along with JavaScript, to teach your pages a few new tricks.

In the last chapter, we left you with a little challenge...the “crack the code challenge”

You were given some HTML with code in an external file, captured from Dr. Evel’s website, that looked like this:

Image
Image

And you needed to figure out Dr. Evel’s passcode using your deductive powers on this code.

So what does the code do?

Let’s walk through this code to see how Dr. Evel is generating his passcodes. After we break down each step, you’ll start to ...

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.
Start your free trial

You might also like

Head First JavaScript Programming

Head First JavaScript Programming

Eric T. Freeman, Elisabeth Robson
Head First HTML and CSS, 2nd Edition

Head First HTML and CSS, 2nd Edition

Elisabeth Robson, Eric Freeman

Publisher Resources

ISBN: 9781098147938Errata Page