The Input type date property autocomplete used to set and retrieve the autocomplete property of input date element. It autocompletes the value which was entered by user previously. It returns a boolean value true, if autocomplete property enabled, otherwise false.
1 <input>.autocomplete
2 <input>.autocomplete = <boolean>
input : A input type date element object to set and retrieve autocomplete property
boolean : It specifies whether an element property autocomplete enabled
Possible values
1. | true : It specifies that it should autocomplete the value that was entered previously by the user |
2. | false : It specifies that the user has to entered value every time |
Input date property autocomplete
1 <!DOCTYPE html>
2 <html>
3 <style>
4 .container {
5 margin: 20px 0;
6 }
7 </style>
8 <body>
9 <h1>The Input date Object</h1>
10 <h2>Example</h2>
11
12 <div class="container">
13 <input type="date" id="date" autocomplete="on" />
14 </div>
15
16 <button onclick="access()">Access</button>
17 <p id="result"></p>
18 <script>
19 function access() {
20 const element = document.getElementById("date");
21 const str = `Is autocomplete enabled : <b>${element.autocomplete}</b>`;
22 document.getElementById("result").innerHTML = str;
23 }
24 </script>
25 </body>
26 </html>
Input date property autocomplete
Related options for your search