Open In App

HTML DOM Input Tel autocomplete Property

The input tel autocomplete property in HTML DOM is used to set or return the value of the autocomplete attribute of an input tel field. The autocomplete attribute is used to specify whether the autocomplete attribute has an “on” or  “off” value. When the autocomplete attribute is set to on, the browser will automatically complete the values based on the user entered before.

Syntax:



telObject.autocomplete
telObject.autocomplete = "on | off" 

Property Values:

Property Value

Description

on

It is the default value. It automatically completes the values.

off

It defines that the user should fill the values of the input Tel field. It does not automatically complete the values. 

Return Value: It returns a string value that represents the state of autocomplete.



Example: This example returns the input tel autocomplete property. 




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML DOM Input Tel autocomplete Property
    </title>
</head>
 
<body style="text-align:center;">
 
    <h1>GeeksforGeeks</h1>
     
    <h2>HTML DOM Input Tel autocomplete Property</h2>
     
    <input type="tel" id="mytel"
        value="6753682635" autocomplete="on">
 
    <p>
        Click on button to check the
        status of autocomplete property
    </p>
 
    <button onclick="myFunction()">
        Click Here!
    </button>
 
    <p id="result"></p>
 
    <script>
        function myFunction() {
            let telAutoComplete = document
                .getElementById("mytel").autocomplete;
 
            document.getElementById("result")
                .innerHTML = telAutoComplete;
        }
    </script>
</body>
 
</html>

Output: 

Supported Browsers:


Article Tags :