$('#chks').change(function(){
$('.chk_p').attr('checked',$(this).attr('checked'));
});
<input id="chks" type="checkbox"/>全選
<input class="chk_p" type="checkbox"/>
<input class="chk_p" type="checkbox"/>
<input class="chk_p" type="checkbox"/>
<input class="chk_p" type="checkbox"/>
<input class="chk_p" type="checkbox"/>
<input class="chk_p" type="checkbox"/>