Open In App

HTML DOM Input Tel select() Method

Improve
Improve
Like Article
Like
Save
Share
Report

The input tel select() method in HTML DOM is used to select the contents of the input tel field. It is an in-built method of the input tel object.

Syntax:

telObject.select()

Parameters: This method does not accept any parameters.

Return Value: This method does not return any value.

Example: Below HTML code illustrate the use of input tel select() method in HTML DOM .  

HTML




<!DOCTYPE html>
<html>
<body style="text-align:center;">
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
    <h2> DOM Input Tel select() Method </h2>
    <legend>
        Phone Number:
        <input type="tel" id="mytel"
            value="6753682635" autofocus>
    </legend>
    <br><br>
    <button onclick="select()">
        Select
    </button>
    <script>
        function select() {
            var x = document.getElementById("mytel").select();
        }
    </script>
</body>
</html>


Output:             

 

Supported Browsers:

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

Last Updated : 29 Aug, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads