Menu ▼

Previous Next

name :

The attribute name will represents the name of the control, in JavaScript we can find the control by it's name also.

Syntax :

<input type="text" name="textboxname" />

Example :



    <title>HTML Tutorial</title>

    <script language="javascript">

        function ShowInput() {

            var input = document.getElementsByName("txtinput");

            if (input.length > 0)






    Enter input :

    <input type="text" name="txtinput" />

    <input type="button" name="btnShow" onclick="ShowInput();" value="Show entered input" />



Output :
HTML Tutorial Enter input :
Previous Next