Previous Example-|-Next Example-|-Return to Chapter Listing

Example 4.2:
Variable Names are Case Sensitive


Clicking on this button shows you the contents of the thetext variable:

Clicking on this button shows you the contents of the TheText variable:

This is the script we used. First, we put this in the HEAD, to declare two variables: <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- var thetext = "The year is " var TheText = thetext + "1996" //--> </SCRIPT> Then we created this button, to display the contents of the thetext variable: <form> <input type="button" value="thetext" onclick="alert(thetext)"> </form> Then we created another button, to show the contents of the TheText variable: <form> <input type="button" value="TheText" onclick="alert(TheText)"> </form>
Previous Example-|-Next Example-|-Return to Chapter Listing