我试图用querySelector从输入单选按钮获取值,但我想写下条件“如果输入被检查=控制台日志是输入值,但如果输入没有被检查=控制台日志是0” 我的代码是: function getVal(){var firstVal= document.querySelector("input[name='price1']:checked");
var firstVal= document.<em
我正在使用一本书学习Javascript教程。练习是使用<input type="search">更改document.querySelector中的背景色。我是用onsubmit和一些条件来做的。但是在接下来的部分中,它必须使用onfocus返回到白色的bckground,而我没有得到。我试过的代码是 if (document.qu
我正在用javascript开发一个函数,它可以根据下拉列表中的选定值显示/隐藏div。hide_show() { document.querySelector('select#b2borprivate').addEventListener('click')=hide_show; var zone = document.<