I have 10 checkbox working properly with check all and uncheck all..not workin with when you click on 'select all' and if uncheck anyone of checkbox then 'select All' remain in check status...
code is here....
function selectAll(status) {
$('input[name=selectedId]').each(function(){
$(this).prop('checked', status);
});
}
<input type="checkbox" class="selectedId" name="selectedId" id="1" />1 <br />
<input type="checkbox" class="selectedId" name="selectedId" id="2" />2 <br />
<input type="checkbox" class="selectedId" name="selectedId" id="3" />3 <br />
<input type="checkbox" class="selectedId" name="selectedId" id="4" />4 <br />
<input type="checkbox" class="selectedId" name="selectedId" id="5" />5 <br />
<input type="checkbox" class="selectedId" name="selectedId" id="6" />6 <br />
<input type="checkbox" class="selectedId" name="selectedId" id="6" />6 <br />
<input type="checkbox" class="selectedId" name="selectedId" id="7" />7 <br />
<input type="checkbox" class="selectedId" name="selectedId" id="8" />8 <br />
<input type="checkbox" class="selectedId" name="selectedId" id="9" />9 <br />
<input type="checkbox" class="selectedId" name="selectedId" id="10" />10<br/>