Skip to content
Related Articles

Related Articles

HTML DOM Input Month list Property

View Discussion
Improve Article
Save Article
  • Last Updated : 01 Aug, 2022

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
  • Internet Explorer 
  • Opera mini 
  • Apple Safari 
  • Firefox

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!