Now it's time to get into some really fun stuff. Yes, Varaibles and functions. Don't worry, it's not as bad as it sounds... JavaScript variables are "containers" for storing information. let's start with declaring varaibles.
Here is what these commands mean:
For example, you could prompt your website users for their first name. When they enter their first name you could store it in a variable called say, firstName. Now that you have the user's first name assigned to a variable, you could do all sorts of things with it like display a personalised welcome message back to the user for example. By using a variable to store the user's first name, you can write one piece of code for all your users.
<script language="javascript" type="text/javascript" >
<!-- hide me
var firstName = prompt("What's your first name?", "");
// end hide -->
<!-- hide me
document.write(firstName);
// end hide -->
</script>
The above example opens a JavaScript prompt, prompting the user for their first name. It will then write the name to the page (in practice, you would output the name somewhere between the
tags).