HTML | DOM Input Month max Property Last Updated : 15 Sep, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The DOM Input Month max property in HTML DOM is used to set or return the value of the max attribute of a Month field. The max attribute specifies the maximum value (Month and year) for a Month field. Syntax: It returns the max property.monthObject.maxIt is used to set the max property.monthObject.max = YYYY-MM Property Values: YYYY-MM: This values states the maximum year and Month. Here YYYY is the year i.e. 2019 and MM is the Month i.e. 02. Return Value: It returns a string which represents the maximum value allowed for a Month field. Example-1: This example returns the Input Month max property. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Input Month max Property </title> </head> <body style="text-align:center;"> <h1>GeeksForGeeks</h1> <h2>DOM Input Month max Property</h2> <form id="myGeeks"> <input type="month" id="month_id" name="geeks" max="2019-12"> </form> <br> <button onclick="myGeeks()">Click Here!</button> <p id="GFG" style="font-size:20px;"></p> <!-- Script to return the max property--> <script> function myGeeks() { var gfg = document.getElementById("month_id").max; document.getElementById("GFG").innerHTML = gfg; } </script> </body> </html> Output: Before clicking on the button: After clicking on the button: Example-2: This Example illustrates how to set the property. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Input Month max Property </title> </head> <body style="text-align:center;"> <h1>GeeksForGeeks</h1> <h2>DOM Input Month max Property</h2> <form id="myGeeks"> <input type="month" id="month_id" name="geeks"> </form> <br> <button onclick="myGeeks()">Click Here!</button> <p id="GFG" style="font-size:20px;"></p> <!-- Script to set the max property--> <script> function myGeeks() { var gfg = document.getElementById("month_id"); gfg.max = "2019-01"; var g = gfg.max; document.getElementById("GFG").innerHTML = g; } </script> </body> </html> Output: Before clicking on the button: After clicking on the button: Supported Browsers: The browser supported by DOM input Month max Property are listed below: Google ChromeInternet Explorer 10.0 +FirefoxOperaSafari Note: In Firefox, the input type="month" element does not show any date field or calendar. Comment More infoAdvertise with us Next Article HTML | DOM Input Month max Property M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML | DOM Input Month min Property The DOM Input Month min property in HTML DOM is used to set or return the value of the min attribute of a Month field. The min attribute specifies the minimum value of Month and year for a Month field. Syntax: It returns the min property.monthObject.minIt is used to set the min property.monthObject. 2 min read HTML DOM Input Month list Property The input month list property in HTML DOM returns a reference to the datalist element that contains an input month field. Syntax: monthObject.list.idReturn 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 retu 1 min read HTML | DOM Input Month form Property The Input Month form property is used for returning a reference to the form that contains the Month field. It is a read-only property. Syntax: monthObject.form Return Value: It returns a form object on success, else if the Month field is not in the form, it returns NULL. Below program illustrates th 1 min read HTML | DOM Input Month type Property The DOM Input Month type Property is used for returning which type of form element a Month field is. Syntax: monthObject.type Return Value: It returns a string value which represent the type of form element the Month field is. Below program illustrates the Month type property: Example: Returning the 1 min read HTML | DOM Input Month step Property The DOM Input Month step Property is used to set or return the value of the step attribute of a month field. The step attribute in HTML is used to set the discrete step size of the element. The default stepping value for month inputs is 1. The step attribute could be used with min and max attribute 2 min read Like