-
qq_捂着心脏说胃疼_0
我写的是不好,但你们都脱离了我要实现的效果,模拟单选,我input都已经隐藏了,我不是刚自学的......
-
tom的猫
在一个页面里的话不能把两组的那么命名一样,否则会有冲突label 的话添加一个 for 属性,内容填input的id即可达到效果,不用写js<form action="#" method="post">
<div>
<p>第一组</p>
<input type="radio" name="one" id="radio1"><label for="radio1">111111111111111111</label>
<input type="radio" name="one" id="radio2"><label for="radio2">222222222222222222</label>
</div>
<div>
<p>第二组</p>
<input type="radio" name="two" id="radio3"><label for="radio3">333333333333333333</label>
<input type="radio" name="two" id="radio4"><label for="radio4">444444444444444444</label>
</div>
</form>
-
只剩下渣
你确定是js代码冲突?不是你html写错了?
两组input你就得用两组name,你用同一个name,当然冲突了。
还有你这代码,我真的无力吐槽,不是科班出身?自学?