Cover by Eric Freeman, Elisabeth Robson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

Chapter 2. Introducing JavaScript and the DOM: A Little Code

image with no caption

JavaScript is going to take you to new places. You already know all about HTML markup (otherwise known as structure) and you know all about CSS style (otherwise known as presentation), but what you’ve been missing is JavaScript (otherwise known as behavior). If all you know about are structure and presentation, sure, you can create some great-looking pages, but they’re still just pages. When you add behavior with JavaScript, you can create an interactive experience; or, even better, you can create full blown web applications. Get ready to add the most interesting and versatile skill in your web toolkit: JavaScript and programming!

Note

And if you need more motivation, the most lucrative!

The Way JavaScript Works

Our goal is to write JavaScript code that runs in the browser when your web page is loaded—that code might respond to user actions, update or change the page, communicate with web services, and in general make your page feel more like an application than a document. Let’s look at how all that works:

image with no caption
image with no caption
image with no caption

What can you do with JavaScript? ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required