Skip to content
Related Articles

Related Articles

HTML DOM Input Number list Property

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

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


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 return the input number list property. 


<!DOCTYPE html>
<body style="text-align:center;">
    <h1 style="color:green;">
    <h2>DOM Input Number list property</h2>
    <legend>Multiples of 5:
        <input type="number" id="myNumber"
            list="numbers" value="10">
    <datalist id="numbers">
        <option value="15" />
        <option value="20" />
        <option value="40" />
        <option value="30" />
        <option value="35" />
    <button onclick="myFunction()">
        Click Here!
    <p id="demo"></p>
        function myFunction() {
            // Returning Input Number list Property
            var x = document.getElementById("myNumber");
            document.getElementById("demo").innerHTML = x;



Supported Browsers:

  • Google Chrome
  • Edge 12 and above
  • Mozilla Firefox
  • Opera
  • Safari

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!