HTML5 input type color: set no color / delete color

后端 未结 1 643
遇见更好的自我
遇见更好的自我 2021-01-11 18:52

Simple question:

(How) is it possible to set the value of an to empty in the colorpicker when selecting such an input in Ch

相关标签:
1条回答
  • 2021-01-11 18:57

    I think it cannot be set to be transparent, but you can modify the start color with value="#colorhex".

    For example;

    <input type="color" value="#0000ff">
    

    http://jsfiddle.net/j3hZB/4/

    Edit: It seems that when input has type="color" there is always a color defined, and there's no way to set that string to empty.

    Although here, the guy with second answer says he figured out a workaround.

    0 讨论(0)
提交回复
热议问题