页面: <td><inputtype='checkbox'id='allCheckbox'class='input-small'onclick="deliveryTrade.checkAll(this)"/></td> 脚本: checkAll:function(obj){ $('[name=rowCheck]:checkbox').prop("checked",$(obj).prop('checked')); }
checkOne: function (obj) { var id = $(obj).attr("id"); if ($.inArray(id, entryTrade.checkData) >= 0) { entryTrade.checkData.splice($.inArray(id, entryTrade.checkData), 1); $(obj).removeAttr("checked"); } else { entryTrade.checkData.push(id); } }