Month 對象是 HTML5 中的新對象。
Month 對象表示 HTML <input type="month"> 元素。
注釋:Internet Explorer 或 Firefox 不支持 <input type="month"> 元素。
您可以通過使用 getElementById() 來訪問 <input type="month"> 元素:
var x = document.getElementById("myMonth");
提示:您也可以通過遍歷表單的 elements 集合來訪問 Month 對象。
您可以通過使用 document.createElement() 方法來創(chuàng)建 <input type="month"> 元素:
var x = document.createElement("INPUT"); x.setAttribute("type", "month");
屬性 | 描述 |
---|---|
autocomplete | 設(shè)置或返回 month 字段的 autocomplete 屬性值。 |
autofocus | 設(shè)置或返回 month 字段在頁面加載后是否應(yīng)自動獲取焦點(diǎn)。 |
defaultValue | 設(shè)置或返回 month 字段的默認(rèn)值。 |
disabled | 設(shè)置或返回 month 字段是否被禁用。 |
form | 返回對包含 month 字段的表單的引用。 |
list | 返回對包含 month 字段的 datalist 的引用。 |
max | 設(shè)置或返回 month 字段的 max 屬性值。 |
min | 設(shè)置或返回 month 字段的 min 屬性值。 |
name | 設(shè)置或返回 month 字段的 name 屬性值。 |
readOnly | 設(shè)置或返回 month 字段是否是只讀的。 |
required | 設(shè)置或返回在提交表單之前是否必須填寫 month 字段。 |
step | 設(shè)置或返回 month 字段的 step 屬性值。 |
type | 返回 month 字段的表單元素類型。 |
value | 設(shè)置或返回 month 字段的 value 屬性值。 |
如對本文有疑問,請?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會為你解答!! 點(diǎn)擊進(jìn)入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號