How can I check if set is pressed with <input> type="color" </input>? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 13

How can I check if set is pressed with <input> type="color" </input>?

Short answer would be appreciated

4th Mar 2017, 8:19 PM
ChessMaster
ChessMaster - avatar
1 Answer
+ 10
<input type="color" id="cl" onchange="getColor(this.value);"> <script> function getColor(c){ alert(c); } </script> You could also get it like the following, but you've got to invoke something to get it: var c = document.getElementById("cl").value;
5th Mar 2017, 1:08 AM
Mark Foxx
Mark Foxx - avatar