<script type="text/javascript">
$(function(){
$.post("house/allperson",function(dd){
$.each(dd, function(key,obj) {
$("#bm").append("<option value="+obj.pid+">"+obj.personName+"</option>")
});
});
$("#dian").click(function(){
var arr=$("[type=checkbox]");
if(this.checked){
$.each(arr, function() {
this.checked=true;
});
}else{
$.each(arr, function() {
this.checked=false;
});
}
});
$("#ck").click(function(){
var arr=$("[type=checkbox]");
var att=[];
$.each(arr, function() {
if(this.value>0){
if(this.checked){
att.push($(this).val());
}
}
});
if(att.length==0){
alert("最少选中一个");
}
$.post("house/delete",{"att":att.join(",")},function(){
location.href="house/allhouse";
})
});
});
</script>
<input type="checkbox" id="dian"/>