YouTip LogoYouTip

Prop Color Value

# HTML DOM Input Color value Property [!(#) Input Color Object](#) ## Example Change the default color of the color picker: document.getElementById("myColor").value = "#FF8040"; [Try it yourself Β»](#) * * * ## Definition and Usage The `value` property sets or returns the value of the `value` attribute of a color picker. The `value` property describes the default color of the color picker. **Note:** The default color value is `#000000` (black). * * * ## Browser Support !(#)!(#)!(#)!(#)!(#) The `value` property is supported in all major browsers. **Note:** Internet Explorer and Safari do not support the `` element. * * * ## Syntax Return the `value` property: ```javascript colorObject.value Set the `value` property: ```javascript colorObject.value = "#hexvalue" ## Property Values | Value | Description | | --- | --- | | _#hexvalue_ | Specifies the color of the color picker. The value must be a hexadecimal value (hex): 3 double-digit numbers, starting with a `#` (e.g., `#FF8040`).
**Note:** Color words (e.g., "red" or "blue") are not allowed.
**Note:** The default value is: `#000000` (black). | ## Technical Details | Return Value: | A string representing a color value | | --- | * * * ## More Examples ## Example Get the color of the color picker: ```javascript var x = document.getElementById("myColor").value; The value of `x` will be: #ff0080 [Try it yourself Β»](#) * * * ## Related Articles HTML Tutorial: (#) HTML Tutorial: [HTML Color Values (HEX)](#) HTML Reference: (#) * * Input Color Object](#)
← Dom Obj DateProp Color Type β†’