代码编辑器:
x
1
拾色器: <input type="color" id="myColor" value="#ff0080">
2
<p>点击 "点我" 按钮获取拾色器颜色</p>
3
<p id="demo"></p>
4
<button onclick="myFunction()">点我</button>
5
<script>
6
function myFunction() {
7
var x = document.getElementById("myColor").value;
8
document.getElementById("demo").innerHTML = x;
9
}
10
</script>
11