Open In App

HTML DOM Input Tel autocomplete Property

Improve
Improve
Like Article
Like
Save
Share
Report

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:

  • It returns the input tel autocomplete property. 
telObject.autocomplete
  • It is used to set the input tel autocomplete property. 
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. 

HTML




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

tel-autocomplete

Supported Browsers:

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


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