Attributes · <input type="color">
Which attributes work on a color input?
A color input has few attributes. value and list do most of the work.
| Attribute | What it does | Docs |
|---|---|---|
value | The starting color as a 6-digit hex with #, like value="#2563eb". Without it, the picker starts at #000000. | MDN |
list | The id of a <datalist> whose <option> hex values show as preset swatches in browsers that support it. | MDN |
name | The key the color is sent under, like brand_color. Without a name, nothing is sent. | |
autocomplete | Lets the browser restore or suggest a value. Color inputs accept it, but most browsers do little with it. | MDN |




