Input Color disabled Property - Disable and enable a color picker: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Color

Description

Input Color disabled Property - Disable and enable a color picker:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<input type="color" id="myColor"><br><br>

<button onclick="disableBtn()">Disable Color Picker</button>
<button onclick="undisableBtn()">Enable Color Picker</button>

<script>
function disableBtn() {//  ww w  .ja v a  2s.com
    document.getElementById("myColor").disabled = true;
}

function undisableBtn() {
    document.getElementById("myColor").disabled = false;
}
</script>
</body>
</html>

Related Tutorials