You can create JavaScript variables with the var keyword, as follows:

<script type="text/javascript">
var a;
var name;
</script>

After the declaration , the variables are empty (they have no values).
you can also assign values to the variables when you declare them,as follows:

<script type="text/javascript">
var a=10;
var name="John";
</script>

Note: When you assign a text value to a variable, use quotes around the value.

eXTReMe Tracker