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

Example 5.3:
Multiplying


Click this button to see the value in the nArea variable, the result of multiplying numbers:


This is the script we used. First we placed this in the HEAD: <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- var nArea = 0 var nWidth = 100 var nLength = 33 nArea = nWidth * nLength //--> </SCRIPT> Then we created this button: <form> <input type="button" name="VariableButton" value="The result of the calculation" onclick="alert(nArea)"> </form>
Previous Example-|-Next Example-|-Return to Chapter Listing