Text.type

JavaScript1.1+, JScript1.0+ Nav3+, IE3+, Opera3+ Syntax

							text.type

Description

The type property of an instance of a Text object returns the type of the text box. This always returns text.

Example

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.

Listing 7.504 Displaying the type Property in an Alert 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"> ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.