Skip to content
Related Articles

Related Articles

HTML DOM Input Search list Property

Improve Article
Save Article
  • Last Updated : 25 Aug, 2022
Improve Article
Save Article

The input  Search list property in HTML DOM is used to return a reference to the list element that contains an input search field.


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 search list property.  


<!DOCTYPE html>
    <title> HTML DOM Input search list property </title>
<body style="text-align:center">
    <h1 style="color:green">
    <h2>DOM Input search list property</h2>
    <label>Search anything: </label>
    <input type="search" list="Hello Geeks"
        id="search_id" value="GeeksforGeeks">
    <datalist id="Hello Geeks">
        <option value="Google" />
        <option value="amazon" />
        <option value="flipkart" />
        <option value="Twitter" />
        <option value="Facebook" />
    <button onclick="btnclick()">Click Here!</button>
    <p id="paraID" style="font-size:20px"></p>
    <!-- script to access search field -->
        function btnclick() {
            var txt = document.getElementById("search_id");
            document.getElementById("paraID").innerHTML = txt;



Supported Browsers:

  • Google Chrome 5 and above
  • Edge 12 and above
  • Mozilla Firefox 4 and above
  • Opera 10.6 and above
  • Safari 5 and above

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!