Easy Tutorial
❮ Prop Style Transition Event Img Onabort ❯

Input Color value Attribute

Input Color Object

Example

Modify the default color of the color picker:


Definition and Usage

The value attribute sets or returns the value of the color picker's value attribute.

The value attribute describes the default color of the color picker.

Note: The default color value is #000000 (black).


Browser Support

All major browsers support the value attribute.

Note: Internet Explorer and Safari browsers do not support the <input type="color"> element.


Syntax

Return the value attribute:

Set the value attribute:

Attribute Values

Value Description
#hexvalue Specifies the color of the color picker. <br> <br> The value must be a hexadecimal value (hex): 3 pairs of digits, <br> starting with a # <br> (e.g., #FF8040). <br> <br> Note: Color words (e.g., "red" or "blue") are not allowed. <br> <br> Note: The default value is: <br> #000000 (black).

Technical Details

| Return Value: | String, representing a color value | | --- | --- |


More Examples

Example

Get the color of the color picker:


Related Articles

HTML Tutorial: HTML Colors

HTML Tutorial: HTML Color Values (HEX)

HTML Reference: HTML <input> value Attribute


❮ Prop Style Transition Event Img Onabort ❯