Input Week max Attribute
Definition and Usage
max
Attribute sets or returns the value of the max attribute of the week field.
HTML max attribute specifies the maximum value for the week field (week and year).
Tip:The max attribute is usually used with min attribute Used 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 |
The maximum allowed week and year as specified. Component Description:
For example: 2023-W36 |
Technical Details
Return Value: | A 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.