-
Book Overview & Buying
-
Table Of Contents
Web Developer's Reference Guide
By :
JavaScript works on sets of statements. These statements have an appropriate syntax where the syntax depends on what the statements contain. A statement can have multiple lines in it. Basically, a statement is a set of instructions given to a computer browser to execute JavaScript code. A statement can return a value that is terminated with a semicolon. A statement can be a call for a certain action, for example:
Document.Write("hello world");The preceding statement calls the in-built Write() function and prints the message hello world on the screen.
We can write multiple statements in one line separated by a semicolon; for example:
var a=20; var b=2;var c=a*b; document.write(c);
A statement can also be terminated with a line break, for example:
var a=20; Document.Write(a);
Each statement in JavaScript runs one by one in order of the given instructions in the JavaScript program.
In JavaScript, there is a difference between a statement and an expression...
Change the font size
Change margin width
Change background colour