Chapter 6. JavaScript: Introduction to Scripting

 

Comment is free, but facts are sacred.

 
 --C. P. Scott
 

The creditor hath a better memory than the debtor.

 
 --James Howell
 

When faced with a decision, I always ask, “What would be the most fun?”

 
 --Peggy Walker
 

Equality, in a social sense, may be divided into that of condition and that of rights.

 
 --James Fenimore Cooper

OBJECTIVES

In this chapter you will learn:

  • To write simple JavaScript programs.

  • To use input and output statements.

  • Basic memory concepts.

  • To use arithmetic operators.

  • The precedence of arithmetic operators.

  • To write decision-making statements.

  • To use relational and equality operators.

Outline

6.1

Introduction

6.2

Simple Program: Displaying a Line of Text in a Web Page

6.3

Modifying Our First Program ...

Get Internet & World Wide Web: How to Program, Fourth Edition 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.