Menu ▼

Previous Next

id :

The attribute id represents the id of the control, we will use id to identify the control, even in JavaScript we will find the control by its id.

Syntax :

<input type="text" id="textboxid" />

Example :



    <title>HTML Tutorial</title>

    <script language="javascript">

        function ShowInput() {

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

            if (input != null)






    Enter input :

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

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



Output :
HTML Tutorial Enter input :
Previous Next