简单教程
提交运行
代码编辑器:
<input type="color" id="myColor"><br><br> <button onclick="disableBtn()">禁用拾色器</button> <button onclick="undisableBtn()">启用拾色器</button> <script> function disableBtn() { document.getElementById("myColor").disabled = true; } function undisableBtn() { document.getElementById("myColor").disabled = false; } </script>
运行结果: