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

Example 16.3:
You Don't Have to Pass Information


Type something into the form, then click on the buttons:


This is the script we used. In the HEAD... <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- function What1() { alert(document.fred.elements[0].value) } function What2() { alert(document.forms[0].elements[0].value) } //--> </SCRIPT> Then this form: <FORM NAME="fred"> <input type="text" size="30"><P> <input type="button" value="document.fred.elements[0].value" onclick="What1()"><P> <input type="button" value="document.forms[0].elements[0].value" onclick="What2()"><P> </FORM>
Previous Example-|-Next Example-|-Return to Chapter Listing