//html
<table id="unit"><tr><th>選項一</th><th>選項二</th><th>姓名</th></tr><tr><td><input type="checkbox" /></td><td><input type="checkbox" /></td><td>小紅</td></tr><tr><td><input type="checkbox" /></td><td><input type="checkbox" /></td><td>小明</td></tr></table>
//jQuery
<script type="text/javascript">$(function(){ $("#unit tr").click(function () { $(this).siblings().find("input[type='checkbox']").removeAttr("checked"); });})</script>
//效果圖,暫時上傳不了動態的,親測有用的
以上就是小編為大家帶來的jQuery實現table中兩列CheckBox只能選中一個的示例的全部內容了,希望大家喜歡哦~
如果大家想了解更多游戲活動與游戲攻略,請持續關注本站,本站小編將在第一時間為大家帶來最好看、最好玩、最新鮮的游戲資訊。更多精彩內容,盡在jb51游戲頻道!
新聞熱點
疑難解答