cx709452428

单选按钮取消选中状态

方法一:

<form>
<input type="radio" name=\'radio\' value="1" onclick=\'check(this)\'>单选一
<input type="radio" name=\'radio\' value="2" onclick=\'check(this)\'>单选二
<input type="radio" name=\'radio2\' value="1" onclick=\'check(this)\'>单选1
<input type="radio" name=\'radio2\' value="2" onclick=\'check(this)\'>单选2
</form>
<script>
var tempradio= null;
function check(checkedRadio)
{
if(tempradio== checkedRadio){
tempradio.checked=false;
tempradio=null;
}
else{
tempradio= checkedRadio;
}
}
</script>


方法二:

分类:

技术点:

相关文章:

  • 2021-11-22
  • 2021-09-22
  • 2022-12-23
  • 2021-12-15
  • 2021-07-10
  • 2022-01-25
  • 2021-10-29
  • 2022-12-23
猜你喜欢
  • 2022-01-03
  • 2021-11-22
  • 2022-12-23
  • 2021-11-17
  • 2021-11-22
  • 2021-11-30
  • 2022-12-23
相关资源
相似解决方案