1: Judge radio
var selected = $('input[name=selectid:checked]').val();//If not selected, val() = null
if(selected == null){
alert("Not selected ! ");
}else{
alert("Selected!");
}
2: Determine checkbox
var n = $("input:checked").length;
if (n==0){
alert("Not selected!");
}else{
alert("Selected!");
}
$("div"). text(n (n <= 1 ? " is" : " are") " checked!");
3: Select all, cancel all selection in checkbox array
$("#selAll").click( function(){
$("input[name='cbox[]']").attr("checked",$(this).attr("checked"));
});