CHAPTER 12

Working with JavaScript

Looking for ways to add action and interest to your website? JavaScript can help you add interactivity to your HTML5 documents. This chapter shows you how to use JavaScript code to make your pages more interesting by changing page content in response to user behavior.

image

Understanding JavaScript

Understanding Script Events and Handlers

Add JavaScript to a Web Page

Link to a JavaScript File

Insert the Current Date and Time

Display an Alert Message Box

Display a Pop-Up Window

Create an Image Rollover Effect

Show a Hidden Element

Change Page Content

Display a Calculation

Understanding JavaScript

You can use snippets ...

Get Teach Yourself Visually™ HTML5 now with the O’Reilly learning platform.

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