November 2011
Intermediate to advanced
384 pages
13h 23m
English
You can use the color input type, new in HTML5, to display a color selection input field on supported web browsers. The actual color selection user interface differs between web browsers, but the idea is to allow the user to visually select a color via a color wheel or square and then translate that value into a standard HTML color code:
<input type='color' name='field' value='color'>
The type='color' attribute value activates the search-specific input options of the user’s web browser, if supported. Additional input element attributes, such as name and value, have the same meaning and functionality common in HTML forms. If you assign value='color' to prepopulate the input field, the color should be in #rrggbb hexadecimal ...
Read now
Unlock full access