Text.type : Text Object : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » Text Object »

 

Text.type







The type property returns the type of the text box. This always returns text.












<html>
    <head>
    <script language="JavaScript1.1">
    <!--
    function getType(){
      alert("The name of this text box is " + document.myForm.elements[0].type);
    }
    -->
    </script>
    </head>
    <body>
    <form name="myForm">
      <input type=TEXT value="First Box" name="myText">
      <input type=BUTTON value="Get Type" name="myButton" onClick='getType()'>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» Text Object