posts - 431,  comments - 344,  trackbacks - 0
设置单个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 周锐 阅读(467) 评论(0)  编辑  收藏 所属分类: AjaxHTML

只有注册用户登录后才能发表评论。


网站导航: