I want to put a coloration function with input[color] but i want to know if this way is compatible with html5 and works with all modern browsers.
And Are there any other ways like JavaScript library or any thing like that.
I try input[color]
I want to put a coloration function with input[color] but i want to know if this way is compatible with html5 and works with all modern browsers.
And Are there any other ways like JavaScript library or any thing like that.
I try input[color]
2
Answers
HTML’s
<input type="color"/>
element is supported by all modern browsers and is included in HTML5. Syntax:The
value
attribute is#
+ hex color in these formats:#rrggbb
,#rgb
(abbreviation),#rrggbbaa
(with alpha)You don’t need any libraries for that.
The
input[type="color"]
attribute is part of HTML5, It allows users to select a color from a color picker.And is natively supported by modern browsers including Chrome, Firefox, Safari, Edge. But in mobile devices apperance may slightly vary.If you need any customization, use js libraries such as jscolor, Pickr