Meeting of Worlds—HTML and JavaScript
So, you know how HTML works, and you now know a little about JavaScript. The next step is to look at how the two come together and work in harmony on a Web page.
Because HTML and JavaScript are entirely separate technologies, rules exist as to how JavaScript can be slotted in to the HTML of a Web page. There are, in fact, several ways to add JavaScript to a Web page, but to get you started we are initially going to concentrate just on the most commonly used and arguably the most flexible method. In this method, JavaScript is inserted in a script block into the <head> tag.
Let's take a look at how we can do this.
The HTML Skeleton
Before moving on, you must be familiar with the anatomy of an HTML page. Here ...
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.