Variables
Back to Javascript
Variables hold values which you can use and manipulate
You can declare them on their own, declare several variables, assign a value with a declaration, declare several variables and assign a value, and assign a variable without having to declare it.
<html>
<head>
<title>Variables</title>
<html>
<body>
<script language="javascript">
<!--
var a;
var b, c;
var d = 10
var e="fred", f="bob";
a = 1;
b = 2;
c = 3;
g = "harry";
document.write("a = ", a );
document.write("<br />b = ", b);
document.write("<br />c = ", c);
document.write("<br />d = ", d);
document.write("<br />e = ", e);
document.write("<br />f = ", f);
document.write("<br />g = ", g);
//-->
</script>
</body>
</html>