設置單個checkbox的值:
$('#checkall').attr('checked', 'true'); 選擇
$('#checkall').attr('checked', ''); 不選
選擇多個checkbox:
$('#suppliersTable input[@type=checkbox]').trigger('click');
選擇所有選中的checkbox:
$('#suppliersTable input[@type=checkbox][@checked="true"]');
選擇所有未選中的checkbox
$('#suppliersTable input[@type=checkbox][@checked=""]');
觸發所有未選中的checkbox的onclick事件:
$('#suppliersTable input[@type=checkbox][@checked=""]').trigger('click');
計算所有選中的checkbox個數:
$('#suppliersTable tbody input[@type=checkbox][@checked="true"]').length;
posted on 2009-06-05 09:56
周銳 閱讀(487)
評論(0) 編輯 收藏 所屬分類:
Ajax 、
HTML