19. Working with Scripts

In This Chapter

Loading an External Script

Adding an Embedded Script

Handling JavaScript Events

While HTML defines your Web page’s content and CSS defines its presentation, JavaScript defines special behavior.

You can write simple JavaScript programs to show and hide content, and you can write more complicated ones that load data and dynamically update your page. You can drive custom HTML5 audio and video element controls, and create browser-based games that use HTML5’s canvas element. And you can write full-blown Web applications that leverage some of the most powerful features in HTML5 and related technologies (they’re advanced topics, so they aren’t covered in this book).

As you can see, JavaScript has quite a range ...

Get HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition now with O’Reilly online learning.

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