Javascript examples for DOM HTML Element:Input Color
The Input object represents an HTML <input> element with type="color".
You can access an <input> element with type="color" by using getElementById():
<!DOCTYPE html> <html> <body> Select your favorite color: <input type="color" id="myColor"> <button onclick="myFunction()">get the color of the color picker</button> <p id="demo"></p> <script> function myFunction() {/* ww w.j a va 2 s .com*/ var x = document.getElementById("myColor").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>