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

Example 10.4:
Referring to Objects


The document.Customer.Lastname.value property of the Lastname text box is set to "Smith" when the button is clicked.



This is the script we used in the HEAD: <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- function ChangeText() { document.Customer.Lastname.value = "Smith" } </script> Later in the page we have this button: <FORM NAME="Customer"> <INPUT TYPE="button" NAME="But1" value="Change the text box's value property" onclick="ChangeText()"> <INPUT TYPE="text" NAME="Lastname" value=""> </FORM>
Previous Example-|-Next Example-|-Return to Chapter Listing