Easy Tutorial
❮ Met Table Deletetfoot Event Oncopy ❯

Input Color autofocus Attribute

Input Color Object

Example

Check if the color picker gains focus automatically when the page loads:


Definition and Usage

The autofocus attribute is used to set or return whether the color picker gains focus automatically 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 Safari browsers do not support the <input type="color"> element.


Syntax

Return the autofocus attribute:

Set the autofocus attribute:

Attribute Values

Value Description
true false Describes whether the color picker gains focus on page load. true - The color picker gains focus<br>false - Default. The color picker does not gain focus

Technical Details

| Return Value: | Boolean, returns true if the color picker automatically gains focus on page load, otherwise returns false. | | --- | --- |


Related Pages

HTML Reference: HTML <input> autofocus Attribute


❮ Met Table Deletetfoot Event Oncopy ❯