title: Make all checkboxes unchecked, then check some
body: <p>Is there a way to make all checkboxes on page unchecked when loading the page and then at the same time if some of them were checked save that in a variable and make them checked. I have tried with this</p>
  
  <pre><code>$('input[id^="chkbx_"]').prop("checked", false);
  
  var a;
  if ($("#chkbx_program_a").prop("checked")){
  a= "true";
  }else{
  a= "false";
  }
  
       $('#chkbx_program_b').prop('checked', a);
  }
  });
  </code></pre>
  
  <p>But still all checkboxes are unchecked.</p>