Mega Code Archive

 
Categories / JavaScript Tutorial / Language Basics
 

Define variable and assign value

< html> <head> <title>Variable Demo</title> <script language="javascript" type="text/javascript"> <!-- var myVar; myVar = "a string"; alert(myVar); //--> </script> </head> <body> <h1>Variable Demo</h1> </body> </html>