Input Month autofocus
Attribute
Example
Check if the month field automatically gains focus upon page load:
Definition and Usage
The autofocus
attribute is used to set or return whether the month field should automatically get focus when the page loads.
This attribute reflects the HTML autofocus
attribute.
Browser Support
All major browsers support the autofocus
attribute.
Note: Internet Explorer 9 and earlier versions, and Opera 12 and earlier versions do not support this attribute.
Note: Internet Explorer and Firefox do not support the <input>
element with the type="month"
attribute.
Syntax
Return the autofocus
attribute:
Set the autofocus
attribute:
Attribute Values
Value | Description | |
---|---|---|
true | false | Specifies whether the month field gains focus upon page load. <br> true - The month field gains focus. <br> false - Default. The month field does not gain focus. |
Technical Details
| Return Value: | Boolean, returns true if the month field automatically gains focus upon page load, otherwise returns false. | | --- | --- |
Related Pages
HTML Reference: HTML <input> autofocus Attribute