Input Month 对象是 html5 新增的
Input Month 对象表示使用 type="month" 的 HTML <input> 元素
Internet Explorer 或 Firefox 浏览器不支持使用 type="month" 属性的 <input> 元素
可以使用 getElementById() 函数来访问使用 type="month" 属性的 <input> 元素
var x = document.getElementById("myMonth");同样可以通过表单的 元素 集合来访问 Input Month 对象
可以使用 document.createElement() 方法来创建使用 type="month" 属性的 <input> 元素
var x = document.createElement("input");
x.setAttribute("type", "month");
| 属性 | 描述 | 
|---|---|
| autocomplete | 设置或返回 month 字段的 autocomplete 属性值 | 
| autofocus | 设置或返回 month 字段在页面加载后是否自动获取焦点 | 
| defaultValue | 设置或返回 month 字段默认的值 | 
| disabled | 设置或返回 month 字段是否可用 | 
| form | 返回使用 month 字段的表单引用 | 
| list | 返回包含了 month 字段的 datalist 引用 | 
| max | 设置或返回 month 字段的 max 属性值 | 
| min | 设置或返回 month 字段的 min 属性值 | 
| name | 设置或返回 month 字段的 name 属性值 | 
| readOnly | 设置或返回 month 字段是否只读 | 
| required | 设置或返回 month 字段在表单中是否为必填字段 | 
| step | 设置或返回 month 字段的 step 属性值 | 
| type | 返回 month 字段的表单元素类型 | 
| value | 设置或返回 month 字段的 value 属性值 | 
本文内容仅供个人学习/研究/参考使用,不构成任何决策建议或专业指导。分享/转载时请标明原文来源,同时请勿将内容用于商业售卖、虚假宣传等非学习用途哦~感谢您的理解与支持!