2

Using

<input type="color">

it is possible to call the system's color picker dialog. That works just fine, but I'd like to use different button for this. Is it possible to manually call the color picker dialog from another element?

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
Vilda
  • 1,675
  • 1
  • 20
  • 50
  • Just assign Id to it and change it using css. Here is one example http://jsfiddle.net/dt53pguq/ – YourFriend Feb 28 '15 at 10:25
  • There's still going to be the outer rectangle though. – Vilda Feb 28 '15 at 10:27
  • The color rectangle is the main functionality of this control. I don't think you can override it, as HTML tag has the most priority. – YourFriend Feb 28 '15 at 10:36
  • 1
    you can hide the color input and use a custom element (any div, button etc) to trigger the click event via javascript on the hidden input element. This way you can style your button as you like. – ynnus Feb 28 '15 at 10:38
  • And how can I do that, ynnus? – Vilda Feb 28 '15 at 10:39
  • 1
    Stack Overflow has answer to this: http://stackoverflow.com/questions/2490825/how-to-trigger-event-in-javascript – ynnus Feb 28 '15 at 10:44

1 Answers1

1

You can define its style, for example remove the border, with the style property:

<input type="color" style="border:none">
Victor
  • 893
  • 1
  • 10
  • 25