`

jquery checkbox 操作 其他checkbox全选 和 不全选

 
阅读更多
//全选
	$("#checkAll").change(function(){
		if("checked" == $(this).attr("checked")){
			$("input[type='checkbox']").attr("checked",true);
		}else{
			$("input[type='checkbox']").attr("checked",false);
		}
	});

  <table id="roleInfo" width="95%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#D7E6CC" style="margin: auto; font-size: 12px;">
        <tr class="c666">
          <th height="20" width="1%" align="center" valign="middle" bgcolor="#F2F9F2"><input id="checkAll" class="checkAll" type="checkbox" />全选</th>
          <th width="10%" bgcolor="#F2F9F2">角色编号</th>
          <th width="10%" bgcolor="#F2F9F2">角色名称</th>
        </tr>
      
      </table>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics