Input Week autofocus Attribute
Definition and Usage
autofocus
Attribute sets or returns whether the week field should automatically gain focus when the page is loaded.
This property reflects the HTML autofocus attribute.
See also:
HTML Reference Manual:HTML <input> autofocus Attribute
Example
Check if the week field will automatically gain focus when the page is loaded:
var x = document.getElementById("myWeek").autofocus;
Syntax
Return the autofocus attribute:
weekObject.autofocus
Set the autofocus attribute:
weekObject.autofocus = true|false
Attribute value
Value | Description |
---|---|
true|false |
Specifies whether the week field should gain focus when the page is loaded.
|
Technical Details
Return Value: | Boolean value, returns if the week field automatically focuses on page load true ; otherwise return false . |
---|
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.