HTML DOM Input Month object
- Previous page <input> image
- Next page <input> number
Month-object
Het Month-object is een nieuw object in HTML5.
Het Month-object vertegenwoordigt de HTML <input type="month">-element.
Opmerking:Internet Explorer of Firefox ondersteunt het <input type="month">-element niet.
Toegang tot het Month-object
U kunt toegang krijgen tot het <input type="month">-element door het gebruik van getElementById():
var x = document.getElementById("myMonth");
Tip:U kunt ook door de formulieren elements-verzameling om toegang te krijgen tot het Month-object.
Maak een Month-object
U kunt een <input type="month">-element maken door het gebruik van de methode document.createElement():
var x = document.createElement("INPUT"); x.setAttribute("type", "month");
Month object properties
Properties | Description |
---|---|
autocomplete | Set or return the value of the month field's autocomplete attribute. |
autofocus | Set or return whether the month field should automatically focus after page loading. |
defaultValue | Set or return the default value of the month field. |
disabled | Set or return whether the month field is disabled. |
form | Return a reference to the form containing the month field. |
list | Return a reference to the datalist containing the month field. |
max | Set or return the value of the month field's max attribute. |
min | Set or return the value of the month field's min attribute. |
name | Set or return the value of the month field's name attribute. |
readOnly | Set or return whether the month field is read-only. |
required | Set or return whether the month field must be filled out before submitting the form. |
step | Set or return the value of the month field's step attribute. |
type | Return the form element type of the month field. |
value | Set or return the value of the month field's value attribute. |
Input Month object methods
Method | Description |
---|---|
select() | Select the content of the month text field. |
stepDown() | Decrement the value of the month field by a specified number. |
stepUp() | Increment the value of the month field by a specified number. |
Standard properties and events
The Month object supports standardsPropertiesandEvents.
Related pages
HTML Tutorial:HTML Forms
HTML Reference Manual:HTML <input> tag
HTML Reference Manual:HTML <input> type attribute
- Previous page <input> image
- Next page <input> number