您现在的位置:首页 >> 前端 >> 内容

全选

时间:2017/2/7 11:12:21 点击:

  核心提示://选中所有 function selectAllOrderFunc() { var selectedAll = $(#all).attr(checked); if(selectedAll == ...
//选中所有
	function selectAllOrderFunc() {
		var selectedAll = $("#all").attr("checked");
		if(selectedAll == "checked") {
			$("#inspectMaterialTrailerBodyLeft tr td input[type='checkbox']").each(function() {
				$(this).attr("checked",true);
			});
		} else {
			$("#inspectMaterialTrailerBodyLeft tr td input[type='checkbox']").each(function() {
					$(this).removeProp("checked");
			});
		}
	}

	<!-- 公司的写法,全选, -->
						<th style="width:80px;" rowspan = "2" class="checkBox">
							<input type="checkBox" name='selectColumnAll' >
						</th>
//全选
$("#selectAll").click(function(){
$("[name=items]:checkbox").each(function(){
$(this).attr("checked",true);
});
});

 

//全不选
$("#unSelect").click(function(){
$("[name=items]:checkbox").each(function(){
$(this).attr("checked",false);
});
});


Tags:全选   
作者:网络 来源:ole_triang