Skip to content
Related Articles

Related Articles

HTML DOM Input Month list Property

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

The input month list property in HTML DOM is used to return a reference to the datalist element that contains an input month 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 month list property.


<!DOCTYPE html>
    <title>HTML DOM Input Month list property</title>
<body style="text-align:center;">
    <h1 style="color:green;">
    <h2>DOM Input Month list property</h2>
    <form id="formID">
       <input type="month" id="month_id" list = "month_list"
             name="geeks" value="2019-03">
         <datalist id="month_list">
            <option value="15" />
            <option value="20" />
            <option value="40" />
            <option value="30" />
            <option value="35" />
    <button onclick="btnclick()">Click Here!</button>
    <p id="paraID" style="font-size:20px;"></p>
    <!-- Script to return the Input Month list property-->
        function btnclick() {
            var gfg = document.getElementById("month_id");
            document.getElementById("paraID").innerHTML = gfg;



Supported Browsers: 

  • Google Chrome 20 and above
  • Edge 12 and above
  • Opera 11 and above

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!