文章詳情頁
無法獲取顏色值
瀏覽:97日期:2022-06-22 17:39:28
問題描述
<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>
我的代碼哪里有問題?
問題解答
回答1:你這獲取的是DOM的value,并沒有涉及到顏色啊。。。
上一條:http后帶s和不帶s有什么區別嗎?下一條:關于圖片無法順利顯示的疑問
相關文章:
1. 注冊賬戶文字不能左右分離2. JavaScript事件3. html5 - ElementUI table中el-table-column怎么設置百分比顯示。4. javascript - table列過多,有什么插件可以提供列排序和選擇顯示列的功能5. python - 使用readlines()方法讀取文件內容后,再用for循環遍歷文件與變量匹配時出現疑難?6. javascript - ES6標準入門中let命令提到的for循環打印i是10,如果不用let怎么替換?7. showpassword里的this 是什么意思?代表哪個元素8. 對mysql某個字段監控的功能9. python - 為什么正常輸出中文沒有亂碼,zip函數之后出現中文編程unicode編碼的問題,我是遍歷輸出的啊。10. html - vue項目中用到了elementUI問題
排行榜
