Open In App

HTML DOM Input Tel form Property

Last Updated : 29 Jul, 2024
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
Report

The DOM Input Tel form Property in HTML is used for returning the reference of the form containing the input tel field. It is a read-only property that returns a form object on success. 

Syntax: 

telObject.form 

Return Value: It returns a string value that specifies the reference of the form containing the Input tel field. The value of this attribute must be the id of the <form> element. 

Example: Below program illustrates the HTML DOM Input Tel form property. 

HTML
<!DOCTYPE html>
<html>
<body style="text-align:center;">
    <h1 style="color:green;">
        GeeksForGeeks
    </h1>
    <h2> DOM Input Tel form Property </h2>
    <form id="myGeeks">
        <input type="tel" id="mytel" 
               value="6753682635" readonly>
    </form>
    <br><br>
    <button onclick="GFG()">
        Return!
    </button>
    <p id="demo" style="font-size:25px"></p>

    <script>
        function GFG() {
            var x = document.getElementById("mytel").form.id;
            document.getElementById("demo").innerHTML = x;
        }
    </script>
</body>
</html>

Output:

sagarhtmGoogleChrome202204171140021

Supported Browsers:

  • Google Chrome 3+
  • Edge 12+
  • Firefox
  • Opera 11+
  • Safari 4+

Article Tags :

Similar Reads