脚本:
function bb(obj,name) { var aa = document.getElementsByName(name); for (var i = 0; i < aa.length; i++) { aa[i].checked = false; } obj.checked = true; }
前台:
<input type="checkbox" name="a" οnclick="bb(this,'a')" /><input type="checkbox" name="a" οnclick="bb(this,'a')" /><input type="checkbox" name="a" οnclick="bb(this,'a')" />
<input type="checkbox" name="b" οnclick="bb(this, 'b')" /> <input type="checkbox" name="b" οnclick="bb(this, 'b')" /> <input type="checkbox" name="b" οnclick="bb(this, 'b')" />
转载于:https://www.cnblogs.com/fightingstepup/p/5138587.html
相关资源:delphi Listview复选框checkbox实现单选的功能