JavaScript Syntax





techstore
 LQ Net Home






Javascript Basics

printpage    Printer Friendly Page

Declare variables [var is lower case]
var cust;
var balance;

Declare on one line.
var cust, balance;

Declare and assign values together.
var balance = 456.30;
var price = 250.00;
var totdue = price * .06;

String variables can be enclosed with single or double quotes. var cust = "Smith, John";
OR var cust = 'Smith, John';



Relational Operators

Logical Operators


Arithmetic Operators


Escape Sequences


Assignment Operators



if (expression) do this;



if (expression) do this ; else if (expression) do this ;




Javascript in HTML

<script type="text/javascript">





























Copyright © 2006-2009, LQ Systems,Inc. All rights reserved.