jquery 1.9 的版本 獲取當前checkbox的選中屬性是否checked
if ( $(this).prop("checked") )
if ( $(this).is(":checked") )
//設置為未選中的值
$("#chk_id").attr("checked",false);
//設置為選中的值
$("#chk_id").attr("checked",true);
$("input[name=agree]" ).attr("checked",true);
//判斷是否已經選中
var check_var = $("#check_id").attr("checked");
if(check_var == '' || check_var == false){
............語句.............
}
$("input[name=check_1[]][checked]").length; 去選中的個數
閱讀更多 PHP開發工程師 的文章