In web application, sometimes you may need to provide color picker option in web page development. HTML5 introduced new input type "color", which allows the user to pick a color and it returns six-digit hexadecimal RGB color value such as #ff0000 for Red Color, #000000 for Black Color and #ffffff for White Color etc.
In order to display color picker in your web page, you have to add type="color" in input element. The whole idea behind this is that a number of standard color choices or the option to select other, which brings up the operating system color picker.
If a browser supports this input type, you can take the advantage of these new feature of HTML5 with very less efforts.
<input id="color" type="color"/>
As of writing, only few browsers provide support for this new feature.
If you want to make your textbox self explanatory, you can use additional attribute "Placeholder" by assigning meaningful text. The "placeholder", in the color textbox example, will look like this:
<input id="color" type="color" placeholder="Pick Color"/>Here is a simple demo.