Easy Tutorial
❮ Prop Error Message Prop Anchor Hreflang ❯

Input Time autofocus Attribute

Input Time Object

Example

Check if the time field automatically gains focus upon page load:


Definition and Usage

The autofocus attribute is used to set or return whether the time 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 or Opera 12 and earlier versions do not support the autofocus attribute.

Note: Internet Explorer or Firefox browsers do not support the HTML <input> element with the type="time" attribute.


Syntax

Return the autofocus attribute:

Set the autofocus attribute:

Attribute Values

Value Description
true false Specifies whether the time field gains focus upon page load. <br> true - The time field gains focus. <br> false - Default. The time field does not gain focus.

Technical Details

| Return Value: | Boolean, returns true if the time field automatically gains focus upon page load, otherwise returns false. | | --- | --- |


Related Pages

HTML Reference: HTML <input> autofocus Attribute


❮ Prop Error Message Prop Anchor Hreflang ❯