将图像定义为提交按钮:
<label for="bdaymonth">Birthday (month and year):</label> <input type="month" id="bdaymonth" name="bdaymonth">
<input type="month">
定义了月份和年份控件。
格式为“YYYY-MM”。
提示: 始终添加 <label>
标签以获得最佳可访问性实践!
表中的数字指定了完全支持该元素的第一个浏览器版本。
Attribute | |||||
---|---|---|---|---|---|
type="month" | 25.0 | 12.0 | ❌ 不支持 | ❌ 不支持 | 10.1 |
<input type="month">