Text.name : Text Object : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » Text Object »

 

Text.name








The name property returns the name of the text box.

This property is often accessed via the elements array of a Form object and used to return the name of the text area.












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







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» Text Object