title: Javascript to check all checkboxes with the same ID when one is checked
body: <p>I am trying to make a simple javascript to mark as checked all checkboxes with the same ID once you check one of them. The problem comes from there that first state the checkbox is unchecked when I check it it works, when I uncheck it it works it does uncheck all the boxes with the same ID again but after that if I try to check it again it does not work.</p>
  
  <p>Here is my code so far: </p>
  
  <pre><code>$('input[id="check_01"]').on('click',function(){
      $('input[id="check_01"]').attr('checked', $(this).is(':checked'))
  });
  </code></pre>
  
  <p>Let me know what the logic of this should be to fix it? In JS Fiddle it works perfectly but not on my web form. </p>
  
  <p>this is the input's code: </p>
  
  <pre><code>&lt;input type="checkbox"  class="aboveage6" id="check_01"  name="utilities[]" value="1 parking"  /&gt; 12&lt;br /&gt;
  &lt;input type="checkbox"  class="aboveage6" id="check_01"  name="utilities_02[]" value="1 parqueo"  /&gt; 12 2&lt;br /&gt;
  </code></pre>