Input Week max attribute
Definition and usage
max
Attribute setting or returning the value of the max attribute of the week field.
The HTML max attribute specifies the maximum value (week and year) for the week field.
Tip:The max attribute is usually used with min attribute Use together to create a series of valid values.
Tip:To set or return the value of the min attribute, use min attribute.
See also:
HTML Reference Manual:HTML <input> max attribute
Instance
Example 1
Get the maximum allowed week and year for the week field:
var x = document.getElementById("myWeek").max;
Example 2
Change the maximum allowed week and year:
document.getElementById("myWeek").max = "2023-W35";
Syntax
Return max attribute:
weekObject.max
Set max attribute:
weekObject.max = YYYY-WWW
Attribute value
Value | Description |
---|---|
YYYY-WWW |
Maximum allowed week and year specified. Component description:
For example: 2023-W36 |
Technical details
Return value: | String value, representing the maximum weeks and years allowed. |
---|
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.