Chapter 2. Combining JavaScript and HTML

The first thing you need to understand if you want to learn how to write JavaScript is how the JavaScript and HTML of a Web page come together. In this chapter, you will learn just that.

This chapter teaches you about the following:

  • How JavaScript is added to the HTML of a Web page

  • The importance of the <head> tag

  • What the <script> block is and how to add it to a Web page

  • How to hide JavaScript from older, non–JavaScript-enabled browsers

Get JavaScript™ 1.5 by Example 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.