Tryit Editor v1.4

<html> <body> <script type="text/javascript"> var firstname; firstname="Hege"; document.write(firstname); document.write("<br />"); firstname="Tove"; document.write(firstname); </script> <p>The script above declares a variable, assigns a value to it, displays the value, change the value, and displays the value again.</p> </body> </html> | Your Result:
Edit the code above and click to see the result. | W3Schools.com - Try it yourself