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

Example 5.7:
Decrementing Variable Values


Click this button to see the value in the nY variable, the result of decrementing the value using the decrement operator:


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