Edit This Code:
<!DOCTYPE html>
<html>
<body>

<h3>A demonstration of how to access a Color picker</h3>

Select your favorite color: <input type="color" id="myColor">

<p>Click the "Try it" button to get the color of the color picker.</p>

<button onclick="myFunction()">Try it</button>

<p><strong>Note:</strong> input elements with type="color" do not show any colorpicker in Internet Explorer and Safari.</p>

<p id="demo"></p>

<script>
function myFunction() {
    var x = document.getElementById("myColor").value;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy