Input Week value attribute
Definition and Usage
value
Attribute settings or return the value of the value attribute of the week field.
The HTML value attribute specifies the week and year for the week field.
See Also:
HTML Reference Manual:HTML <input> value Attribute
Example
Example 1
Set the week and year of the week field:
document.getElementById("myWeek").value = "2023-W06";
Example 2
Get the week and year of the week field:
var x = document.getElementById("myWeek").value;
Syntax
Return value attribute:
weekObject.value
Set value attribute:
weekObject.value = YYYY-WWW
Attribute Value
Value | Description |
---|---|
YYYY-WWW |
Specify week and year. Component Description:
For example: 2023-W36 |
Technical Details
Return Value: | A string value representing the year and week of the week field. |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 10.0 | Support | Support | Support |
Note:The <input type="week"> element does not display any date field/calendar in Firefox.