title: Check/Uncheck checkboxes
body: <p>HTML:</p>
  
  <pre><code>&lt;ol&gt;
   &lt;span&gt;Select All&lt;input id='selectall' type="checkbox" onclick='test(this.id);'&gt;
      &lt;ul&gt;
        &lt;span class='selectall'&gt;1.&lt;input type="checkbox" class='selectall'&gt;&lt;/span&gt;
        &lt;span class='selectall'&gt;2.&lt;input type="checkbox" class='selectall'&gt;&lt;/span&gt;
        &lt;span class='selectall'&gt;3.&lt;input type="checkbox" class='selectall'&gt;&lt;/span&gt;
        &lt;span class='selectall'&gt;4.&lt;input type="checkbox" class='selectall'&gt;&lt;/span&gt;
        &lt;span class='selectall'&gt;5.&lt;input type="checkbox" class='selectall'&gt;&lt;/span&gt;
      &lt;/ul&gt;
   &lt;/span&gt;
  &lt;/ol&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>function test(clicked_id) {
      if ($("#" + clicked_id).prop("checked", true)) {
          $('#' + clicked_id + ' .' + clicked_id).prop('checked', true);
      } else {
          $('#' + clicked_id + ' .' + clicked_id).prop('checked', false);
      }
  }
  </code></pre>
  
  <p><a href="https://jsfiddle.net/j59eeqgu/" rel="nofollow">https://jsfiddle.net/j59eeqgu/</a></p>
  
  <p>I want to select my main-checbox and to have the other checkboxes checked as well, but I am doing something wrong. When I try to select my main-checkbox, nothing happens.</p>