title: how to select / unselect the checkboxes using javascript/jquery
body: <p>I have the following html code </p>
  
  <h2>html code</h2>
  
  <pre><code>&lt;p&gt;&lt;a href="" onclick="select()"&gt;Select All&lt;/a&gt;&amp;nbsp; / &amp;nbsp;&lt;a href="" onclick="unselect()" &gt;Unselect All&lt;/a&gt; &lt;/p&gt;
  
  {% for field in fields %}
    &lt;div class="contact_align"&gt;    
      &lt;input id="select-unselect" type="checkbox" name="invite" value="so"&gt;{{ field }}
    &lt;/div&gt;
  {% endfor %}
  
  &lt;script type="text/javascript"&gt;
      function select(){
                  $('#select-unselect').attr('checked',true);
              }
      function unselect(){
                  $('#select-unselect').attr('checked',false);
              }               
  &lt;/script&gt;
  </code></pre>
  
  <p>so above is my code, and the functionality is not working , so can anyone please let me know what i am doing wrong in the above code and make it work ?</p>