Table of Contents

About

This article shows you how to add a color value with an input control 1) in a form.

Example

No value

The default value is black.

<input type="color"  name="color"  />
  • Output:

Specific color

Example:

<input type="color"  name="color" value="#00FFFF" />
  • Output:

Browser native Validation

A color input's value is valid if the browser (user agent) can convert the user's input into seven-character lower-case hexadecimal notation.