select all and unselect checkbox with jquery
<p>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...</p>

<p>code is here....</p>

<pre><code> function selectAll(status) {
       $('input[name=selectedId]').each(function(){
         $(this).prop('checked', status);
      });

    }


   &lt;input type="checkbox" class="selectedId" name="selectedId" id="1" /&gt;1 &lt;br /&gt;
   &lt;input type="checkbox" class="selectedId" name="selectedId" id="2" /&gt;2 &lt;br /&gt;
   &lt;input type="checkbox" class="selectedId" name="selectedId" id="3" /&gt;3 &lt;br /&gt;
   &lt;input type="checkbox" class="selectedId" name="selectedId" id="4" /&gt;4 &lt;br /&gt;
   &lt;input type="checkbox" class="selectedId" name="selectedId" id="5" /&gt;5 &lt;br /&gt;
   &lt;input type="checkbox" class="selectedId" name="selectedId" id="6" /&gt;6 &lt;br /&gt;
   &lt;input type="checkbox" class="selectedId" name="selectedId" id="6" /&gt;6 &lt;br /&gt;
   &lt;input type="checkbox" class="selectedId" name="selectedId" id="7" /&gt;7 &lt;br /&gt;
   &lt;input type="checkbox" class="selectedId" name="selectedId" id="8" /&gt;8 &lt;br /&gt;
   &lt;input type="checkbox" class="selectedId" name="selectedId" id="9" /&gt;9 &lt;br /&gt;
   &lt;input type="checkbox" class="selectedId" name="selectedId" id="10" /&gt;10&lt;br/&gt;
</code></pre>