August 1999
Intermediate to advanced
1488 pages
72h 53m
English
text.typeThe type property of an instance of a Text object returns the type of the text box. This always returns text.
Listing 7.504 has a text box and a button. When the button is clicked, an alert box is popped up that displays the type property of the text box.
<html> <head> <script language="JavaScript1.1"> <!-- Hide // Display an alert box that contains the type of the // text box. function getType(){ alert("The name of this text box is " + document.myForm.elements[0].type); } // End hide ---> </script> </head> <body> <form name="myForm"> <input type=TEXT value="First Box" name="myText"> ... |
Read now
Unlock full access