Mega Code Archive

 
Categories / JavaScript Tutorial / Language Basics
 

Assign one variable to another variable

< html> <head> <title>A Simple Page</title> <script language="javascript"> <!-- yourname = prompt("What is your name?","Type your name here ..."); alert(yourname); yourname2 = yourname; alert(yourname2); yourname = prompt("Type something different in","Something different ..."); alert(yourname); alert(yourname2); //  --> </script> </head> <body> </body> </html>