HTML | DOM Input Month Object Last Updated : 29 Aug, 2022 Comments Improve Suggest changes Like Article Like Report The Input Month Object in HTML DOM is used to represent an HTML input element with type= "month" attribute. The input element with type= "month" attribute can be accessed by using getElementById() method. Syntax: It is used to access <input> element with type="month" attribute.document.getElementById("id");It is used to create <input> element with type="month" attribute.document.createElement("input"); Property Values: PropertyDescriptiontypeThis property is used to return the type of form element of the month field.valueThis property is used to set or return the value of the value attribute of a month field.autocompleteThis property is used to set or return the value of the autocomplete attribute of a month field.autofocusThis property is used to set or return whether a month field should automatically get focus when the page loads.defaultValueThis property is used to set or return the default value of a month field.disabledThis property is used to set or return whether a month field is disabled or not.formThis property is used to return reference to the form that contains the month field.listThis property is used to return a reference to the datalist that contains the month field.maxThis property is used to set or return the value of the max attribute of a month field.minThis property is used to set or return the value of the min attribute of a month field.nameThis property is used to set or return the value of the name attribute of a month field.placeholderThis property is used to set or return the value of the placeholder attribute of a month field.readOnlyThis property is used to set or return whether the month field is read-only or not.requiredThis property is used to set or return whether the month field must be filled out before submitting a form.stepThis property is used to set or return the value of the step attribute of a month field. Input Month Object Methods: MethodDescriptionstepDown()This method is used to decrements the value of the input month by a specified number.select()This method is used to select the Input month field content.stepUp()This method is used to increment the value of the input month by a specified number. Example 1: This example use getElementById() method to access <input> element with type="month" attribute. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Input Month Object </title> </head> <body> <h1>GeeksforGeeks</h1> <h2>DOM Input Month Object</h2> <input type = "month" id = "month" value = "2018-02"> <button onclick = "myGeeks()">Click Here!</button> <p id = "GFG"></p> <!-- script to access input element of type month attribute --> <script> function myGeeks() { var val = document.getElementById("month").value; document.getElementById("GFG").innerHTML = val; } </script> </body> </html> Output: Before click on the button: After click on the button: Example 2: This example use document.createElement() method to create <input> element with type="month" attribute. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Input Month Object </title> </head> <body> <h1>GeeksforGeeks</h1> <h2>DOM Input Month Object</h2> <button onclick = "myGeeks()">Click Here!</button> <!-- script to create input element of type month attribute --> <script> function myGeeks() { /* Create an input element */ var x = document.createElement("INPUT"); /* Set the type attribute */ x.setAttribute("type", "month"); /* Set the value to type attribute */ x.setAttribute("value", "2018-02"); /* Append the element to body tag */ document.body.appendChild(x); } </script> </body> </html> Output: Before click on the button: After click on the button: Supported Browsers: Google Chrome 20 and aboveEdge 12 and aboveOpera 11 and above Comment More infoAdvertise with us Next Article HTML | DOM Input Month Object D divyatagoel0709 Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML | DOM Style borderSpacing Property The DOM Style borderSpacing Property is used to set or return the spacing between the cells in a table. Syntax: To get the borderSpacing propertyobject.style.borderSpacingTo set the borderSpacing propertyobject.style.borderSpacing = "length | initial | inherit" Return Values: It returns a string val 3 min read HTML DOM Audio Object The Audio object is used for representing an HTML <audio> element. The Audio Object is a new object in HTML5. Syntax: For creating an <audio> element:let gfg = document.createElement("AUDIO")For accessing an <audio> element:let x = document.getElementById("myAudio") Property Values 4 min read HTML | DOM Window stop() Method The stop() method in DOM is used to stop the window from loading resources in the current browsing context, similar to the browser's stop button. Syntax: window.stop() Example: Stop window from loading. html <!DOCTYPE html> <html> <head> <title> HTML | DOM Window stop() Metho 1 min read HTML | DOM Ol reversed Property The DOM Ol reversed Property is used to set or return whether the list items are in Descending order(9, 8, 7, 6, ...) or in Ascending order(1, 2, 3, 4...). Syntax: It is used to return the reversed property.olObject.reversedIt is used to set the reversed property.olObject.reversed = true|false Prope 2 min read HTML | DOM Ol type Property The DOM Ol type Property is used to set or return the type attribute in an ordered list. This attribute defines which type(1, A, a, I and i) of order you want in your list numeric, alphabetic or roman numbers. Syntax: It is used to return the type property. olObject.type It is used to set the type p 2 min read HTML | DOM Form enctype Property The Form enctype property in HTML DOM is used to set or return the value of the enctype attribute in a form. This attribute specifies the data that will be present in the form should be encoded when submitting to the server. This type of attribute can be used only if method = "POST". Syntax: It is u 3 min read HTML DOM Form reset() Method The reset() method in the HTML DOM is used to reset a form fields to their default values. When a form is reset, all user input is cleared, and the fields revert to their initial states.SyntaxformObject.reset()Example: In this example, clicking the reset button clears the form inputs. html<!DOCTY 1 min read HTML | DOM Form submit() Method The form submit() Method in HTML DOM is used to send the form data to the web-server. It works as same as submit button. It does not contain any parameters. Syntax: formObject.submit()Example: index.html<!DOCTYPE html> <html> <head> <title> HTML DOM Form submit() Method </ 1 min read HTML | DOM Location Search Property The Location Search property in HTML DOM is used to set or return the query part of URL including question mark. The query part is the part of URL after the question mark. Syntax: It returns the location search property.location.searchIt is used to set the location search property.location.search = 1 min read HTML DOM Form action Property The HTML DOM Form action property allows accessing and modifying the action attribute of a form element through JavaScript. It determines the URL where form data is submitted when the form is submitted. Syntax: It is used to return the action property. formObject.actionIt is used to set the action p 3 min read Like