Input type month property list in Javascript
The Input type month property list used to set and retrieve a reference to the datalist that contains the month input field. It returns a reference to the datalist, if month input field contain, otherwise null.
Syntax
 1 <input>.list // to retrieve
 2 <input>.list = <datalist> // to set
input : A input type month element object to set and retrieve list property
datalist : It specifies the reference of datalist element
Input month property list
 1 <!DOCTYPE html>
 2 <html>
 3 <style>
 4   .container {
 5     margin: 20px 0;
 6   }
 7 </style>
 8 <body>
 9 	<h1>The Input Month Object</h1>
 10 	<h2>Example</h2>
 11 	
 12 	<div class="container">
 13 	  <input type="month" id="month" list="options"
 14 	    value="2021-03" />
 15 	  <datalist id="options">
 16 	    <option value="15" />
 17 	    <option value="20" />
 18 	    <option value="40" />
 19 	    <option value="30" />
 20 	    <option value="35" />
 21 	  </datalist>
 22 	</div>
 23 	
 24 	<button onclick="access()">Access</button>	
 25 	<p id="result"></p>
 26 	<script>
 27 	function access() {
 28 	  const element = document.getElementById("month");
 29 	  const str = `The datalist ID : <b>${element.list.id}</b>`;
 30 	  document.getElementById("result").innerHTML = str;
 31 	}
 32 	</script>
 33 </body>
 34 </html>
Input month property list
Privacy Policy
Terms of Service
Disclaimer
Contact us
About us