HTML DOM Input Text list Property Last Updated : 26 Aug, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The input Text list property in HTML DOM is used to return a reference to the datalist element that contains an input text field. Syntax: textObject.list.id Return Value: It returns a string value that represents the value of the id attribute of the datalist element. Example: Below HTML code used to return the input text list property. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Input Text list Property</title> </head> <body style="text-align:center"> <h1 style="color:green"> GeeksforGeeks </h1> <h2>DOM Input Text list property</h2> <label><b>Your Cars Name:</b> </label> <input type="text" list="cars" id="text_id" value=""> <datalist id="cars"> <option value="BMW" /> <option value="Bentley" /> <option value="Mercedes" /> <option value="Audi" /> <option value="Volkswagen" /> </datalist><br><br> <button onclick="btnclick()">Click Here!</button> <p id="paraID" style="font-size:20px"></p> <!-- script to access text field --> <script> function btnclick() { var txt = document.getElementById("text_id").list.id; document.getElementById("paraID").innerHTML = txt; } </script> </body> </html> Output: Supported Browsers: Google Chrome 1Edge 12Mozilla Firefox 1OperaSafari 1 Comment More infoAdvertise with us Next Article HTML DOM Input URL list Property M manaschhabra2 Follow Improve Article Tags : HTML HTML-DOM HTML-Property Similar Reads HTML DOM Input Time list Property The input Time list property in HTML DOM is used to return a reference to the list element that contains an input Time field. Syntax: timeObject.list.idReturn value: It returns a string value that represents the value of the id attribute of the datalist element. Example: Below HTML code is used to r 1 min read HTML DOM Input Range list Property The input Range list property in HTML DOM is used to return a reference to the datalist element that contains an input range field. Syntax: rangeObject.list.id Return Value: It returns a string value that represents the value of the id attribute of the datalist element. Example: Below HTML code is u 1 min read HTML DOM Input URL list Property The input URL list property in HTML DOM is used to return a reference to the datalist element that contains an input URL field. Syntax: urlObject.list.id Return Value: It returns a string value that represents the value of the id attribute of the datalist element. Example: Below HTML code is used to 1 min read HTML DOM Input Search list Property The input Search list property in HTML DOM is used to return a reference to the list element that contains an input search field. Syntax searchObject.list.id Return value: It returns a string value that represents the value of the id attribute of the datalist element. Example: Below HTML code used t 1 min read HTML | DOM Input Text maxLength Property The DOM Input Text maxLength Property in HTML DOM is used to set or return the value of maxlength attribute of a Text Input Field. It specifies the maximum number of characters that have been allowed in the text field. The default value of Input Text maxLength property is 524288. Syntax: It returns 2 min read HTML | DOM Input Text pattern Property The Input Text pattern Property in HTML DOM is used to set or return the pattern attribute of an text field. It is used to specify the regular expression on which the input elements value is checked. Use the global title attribute to describe the pattern for helping the user. Syntax: It returns the 2 min read Like