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? ...

Get Head First HTML5 Programming 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.