1:判断radio
var selected = $('input[name=selectid:checked]').val();//若未被选中 则val() = null
if(selected == null){
alert("未选中!");
}else{
alert("选中!");
}
2:判断checkbox
var n = $("input:checked").length;
if(n==0){
alert("未选中!");
}else{
alert("选中!");
}
$("div").text(n + (n 3:checkbox数组全选、取消全选
$("#selAll").click(function(){
$("input[name='cbox[]']").attr("checked",$(this).attr("checked"));
});