<form>
<div>
<input type="color" name="color" id="color"> <input type="button" name="btn" id="btn" value="获取颜色">
<input type="text" name="color_value" id="color_value"> </div></form>
<script> document.getElementById('btn').onclick=function(){ document.getElementByid('color_value').value=document.getElementByid('color').value; } </script>
我的代码哪里有问题?
团子2019-04-03 11:38:23
What you are getting is the value of the DOM, and does not involve color. . .