skip to Main Content

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


  1. HTML’s <input type="color"/> element is supported by all modern browsers and is included in HTML5. Syntax:

    <input type="color" value="#ffffff" />
    

    The value attribute is # + hex color in these formats:

    • #rrggbb,
    • #rgb (abbreviation),
    • #rrggbbaa (with alpha)

    You don’t need any libraries for that.

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search