HTML: <input type="color">
XHTML: <input type="color"/>  or  <input type="color" />

HTML5 only. Creates a color well control for selecting a color value.

Start/End Tags

This is an empty element. In HTML, the end tag is forbidden. In XHTML, the element must be closed with a trailing slash as just shown. Developers may include a space character before the slash for backward compatibility with older browsers.


  • HTML5


Values: on | off
HTML5 only. Allows the user agent (browser) to fill in a field automatically (on) or requires the user to enter the information every time (off). Omitting this attribute causes the control to inherit the autocomplete setting for the associated form element.


Values: None in HTML. (autofocus="autofocus" in XHTML)
HTML5 only. Indicates the control should have focus (be highlighted and ready for user input) when the document loads.


Values: None in HTML. (disabled="disabled" in XHTML)
Disables the control for user input. It can be altered only via a script. Browsers may display disabled controls differently (grayed out, for example), which could be useful for dimming certain controls until required info is supplied.


Values: id of the form owner
HTML5 only. Explicitly associates the input control with its associated form (its form owner). With this method, the input control does not need to be a child of the applicable form element.


Values: id of datalist
HTML5 only. Indicates that the control has a list of predefined suggestions for the user, which are provided by a datalist element. The value of the list attribute is the id of the associated datalist.


Values: text
Required by all input types except submit and reset. Assigns a name to the control; a script program uses this name to reference the control.


Values: color value (ex., #rrggbb
Specifies the initial value for this control.
<input type="color" value="3D458A">

Rendered Example

The color input type should be a color-picker widget, but until that can be implemented, the webkit rendering engine in this device displays it as a text input.