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

Example 5.13:
Type Conversion


Click this button to see the value in the sDate variable, calculated from a mixture of two numeric and one string variables:


This is the script we used. First we placed this in the HEAD: <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- var sMonth = "August" var nYear = 1996 var nDay = 15 var sDate = sMonth + " " + nDay + ", " + nYear //--> </SCRIPT> Then we created this button: <form> <input type="button" name="VariableButton" value="sDate" onclick="alert(sDate)"> </form>
Previous Example-|-Next Example-|-Return to Chapter Listing