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"));
});
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn