Open In App

HTML DOM Input Tel select() Method

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 .  




<!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:

Article Tags :