Latest web development tutorials

HTML DOM Input Month Object

Input Month Object

Input Month object is a new HTML5.

Input Month object representation using type = "month" in the HTML <input> elements.

Note: Internet Explorer or Firefox browser does not support type = "month" <input> element attributes.

Object Access Input Month

You can use getElementById () function to access using type = "month" <input> element attributes:

var x = document.getElementById ( "myMonth" ); try

Tip: You can also form elements to access the Input Month collection of objects.

Create Object Input Month

You can use document.createElement () method to create using the type = "month" attribute of <input> element:

var x = document.createElement ( "INPUT");
x.setAttribute ( "type", "month "); try

Input Month Object Properties

Attributes description
autocomplete Sets or returns the month field autocomplete attribute value
autofocus Sets or returns the month field whether to automatically get the focus when the page loads
defaultValue Sets or returns the default value of the month field
disabled Sets or returns the month field is available
form Returns month reference form fields
list Returns the month field datalist references
max Sets or returns the month field max attribute value
min Sets or returns the property value of the month field min
name Sets or returns the month field name attribute value
readOnly Sets or returns the month field is read-only
required Sets or returns the month in the form field, whether a required field
step Sets or returns the month field step property values
type Returns the month field of the form element type
value Sets or returns the month field value attribute value

Standard properties and events

Input Month Object also supports standard attributes and events .


related articles

HTML Tutorial: HTML Forms

HTML Reference Manual: HTML <the INPUT> tag

HTML Reference Manual: HTML <the INPUT> of the type attribute