Open In App

HTML DOM Input Tel type Property

Last Updated : 18 Oct, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The DOM Input tel type property in HTML DOM is used to return the type of form element of the input tel field. It always returns the “tel” for an Input tel field.

Syntax:

telObject.type

Return Values: It returns a string value that represents the type of form element of the tel field.

The below program illustrates the input tel type property in HTML DOM. 

Example: This example returns the type of form element of the input tel field. 

HTML




<!DOCTYPE html>
<html>
<body style="text-align:center;">
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
    <h2> DOM Input Tel type property </h2>
    <legend>
        Phone Number:
        <input type="tel" id="mytel"
            value="6753682635" required>
    </legend>
    <br><br>
    <button onclick="myClick()">
        submit!
    </button>
    <p id="demo" style="font-size:25px"></p>
 
    <script>
        function myClick() {
            var x = document.getElementById("mytel").type;
            document.getElementById("demo").innerHTML = x;
        }
    </script>
</body>
</html>


Output:

 

Supported Browsers:

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

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads