Chapter 2: Building a JavaScript Program
In This Chapter
Understanding the basic syntax of JavaScript
Implementing JavaScript functions
Working with JavaScript and HTML
Using JavaScript with a web browser
The preceding chapter shows how to add the JavaScript tag to a page, and this chapter concentrates on what you can do after that. Key to understanding a programming language is learning its syntax. Just like when you learn a foreign language and you need to learn the words and grammar of the language, the syntax of a programming language is just that: the words and grammar that make up the language.
JavaScript is viewed through a web browser and programmed in a text editor, just like HTML and CSS. The examples you see throughout this chapter can be programmed just like any of the other examples you see throughout the book.
In this chapter, you’ll see how to build a JavaScript program, including some of the ins and outs of programming in JavaScript.
Getting Started with JavaScript Programming
Since this might be your first exposure to programming of any kind, this section starts ...