Using the input Element to Obtain a Color
Description
The color type of input element restricts the user to selecting a color.
Color values are expressed as exactly seven
characters: a leading #, followed by three two-digit hexadecimal values
representing the red, green, and blue values (for example, #FF1234
).
Example
You can see this type of input element in use in the following code.
<!DOCTYPE HTML>
<html>
<body>
<form method="post" action="http://example.com/form">
<p>
<label for="color"> Color:
<input type="color" id="color" name="color" />
</label>
</p><!--from ww w.j a v a2 s . co m-->
<input type="submit" value="Submit Vote" />
</form>
</body>
</html>