Input Week value 屬性
定義和用法
value
屬性設置或返回星期字段的 value 屬性的值。
HTML value 屬性為星期字段規定周和年。
另請參考:
HTML 參考手冊:HTML <input> value Atribute
實例
例子 1
設置星期字段的周和年:
document.getElementById("myWeek").value = "2023-W06";
例子 2
獲取星期字段的周和年:
var x = document.getElementById("myWeek").value;
語法
返回 value 屬性:
weekObject.value
設置 value 屬性:
weekObject.value = YYYY-WWW
屬性值
值 | 描述 |
---|---|
YYYY-WWW |
規定周和年。 组件說明:
Halimbawa: 2023-W36 |
Teknikal na Detalye
Halimbawa ng Balya: | String value, representing the year and week of the week field. |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Suporta | 10.0 | Suporta | Suporta | Suporta |
Pagsisiwalat:Ang elemento <input type="week"> ay hindi nagpapakita ng anumang lapad ng petsa o kalendaryo sa Firefox.