Well i will show you more to work on variables
PHP Code:
<script type="text/javascript"> // Don't forget hehe..
</script> // End of the script
Ok between the script type and script end starts the text you know that already...
Now every variable starts with var for example
var name
You created the variable called "name"
Ok, and in the var name you should put this so always when you use this variable to show text
var name="Your text here";
Congulrations... you created variable called name with the text "Your text here" now you can use it anytime. Here is example.....
PHP Code:
var name="Your text here"; // The text and variable called NAME you can change it anytime..
document.write(name); // This is your variable called name and always when you write (name) in text box or alert the current text from the variable will be there..
To write alertbox its simple you don't need variables, strings etc..
alert("Your text here"); // Always when someone open this website, there will pop up alert window just like error and will show your text there..
Working with more variables and count them..
var name(1+1);
alert(name); // There will be 2 because in the variable it counts 1+1 and in the alert box shows the answer..
PHP Code:
var num1=100; // This is number 100 on variable 1 just like the text
var num2=200; // This is number 200 just on variable like normal text
var answer=(num1+num2); // This count the variable num1 and num2 together
document.write(answer); // We have the variable answer there, the variables are counted together and in the document will be 300 ! 100+200=300.






