Input Month typeProperty

Input Month 对象参考手册Input Month Object

Example

Return the form element type of the month field:

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

The result of x could be:

month

Try it Yourself »

Definition and Usage

The type property returns the form type of the month field.

Note:In the above examples, Opera, Chrome and Safari browsers return "month", but Internet Explorer and Firefox return "text".


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All mainstream browsers support the type property.

Note:Internet Explorer or Firefox browsers do not support the <input> element with type="month".


Syntax

monthObject.type

Technical Details

Return value: String, representing the form element type of the month field.


Input Month 对象参考手册Input Month Object Other Extensions