Hi,
I want to change the value
attribute of a <input type="color">
element. It works if I clicked it, but the display color of the input button is not changing. If I change the color manually from beginning, it works (but I have to change it on runtime).
Watch this JSFiddle to get what I mean: http://jsfiddle.net/5u544/
Thanks and greetings Mat
Edit: Like in the comments below, the problem was the difference between object attributes and properties. Credits to @Navin for this ;)
you can use the .val()
property to set the value like this
$("#test").val("#ff66ff");
JSFiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With