HTML DOM Input Month value property
Examples
Set the month field of the year and month:
document.getElementById("myMonth").value = "2014-02";
try it"
Definition and Usage
value attribute is used to set the property value or return value month field.
value attribute describes the year and month month field.
Browser Support
All major browsers support attribute value
Note: Internet Explorer or Firefox browser does not support type = "month" <input> element attributes.
grammar
Returns the value property:
monthObject .value
Set the value property:
monthObject .value=YYYY-MM
Property Value
值 | 描述 |
---|---|
YYYY-MM |
描述了年和月。实例解析:
|
technical details
return value: | String representing the year and month of month field |
---|
More examples
Examples
Get month field of the year and month:
var x = document.getElementById("myMonth").value;
x The output is: 1997-11
try it"
Related Pages
HTML Reference Manual: HTML <the INPUT> value The property
