title: keep checkboxes checked after page refresh
body: <p>I have a couple of checkboxes. when any of them are clickd/checked and the search button is clicked, will grab their values and pass to the url as querystring and refresh the page returning results matching the passed query values.
  like this: mysite.com/result.aspx?k="Hospital" OR "Office" OR "Emergency"</p>
  
  <p>I am able to grab the values after 'k='. I have "Hospital" OR "Office" OR "Emergency" captured and stored in a variable. Now I need to reset the checked state of checkboxes based on these values after the page reloads and forgets the previous state of the controls. I couldn't move any further than this. Can someone help me?</p>
  
  <pre><code>  var checkedOnes=decodeURI(location.href.match(/\&amp;k\=(.+)/)[1]);
          if (value.length == 2) {
              $('input[name="LocType"][value="' + value[1] + '"]').prop('checked', true);
          }  
  </code></pre>
  
  <hr>
  
  <p>This is how I am capturing the checkboxes values and passing to the URL:</p>
  
  <pre><code>var checkboxValues = $("input[name=LocType]:checked").map(function() {
          return "\"" + $(this).val() + "\"";}).get().join(" OR ");
  
      window.location= url+checkboxValues;
  </code></pre>
  
  <hr>
  
  <pre><code>    &lt;div class="LocTypeChkBoxesSearch"&gt;
      &lt;div class="LocTypeChkBoxes"&gt;
          &lt;input name="LocType" type="checkbox" value="Hospital"/&gt;HOSPITALS&amp;#160;&amp;#160;
          &lt;input name="LocType" type="checkbox"  value="Office"/&gt;  PHYSICIAN OFFICES&amp;#160;&amp;#160;
          &lt;input name="LocType" type="checkbox"  value="Emergency"/&gt;EMERGENCY CENTERS&amp;#160;&amp;#160;
          &lt;input name="LocType" type="checkbox"  value="Out-Patient"/&gt;OUT-PATIENT CENTERS&amp;#160;&amp;#160;
          &lt;input name="LocType" type="checkbox" value="Facility"/&gt;FACILITIES
      &lt;/div&gt;
      &lt;div class="searchBtnHolder"&gt;&lt;a class="searchButton" href="#" type="submit" &gt;&lt;span&gt;GO&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>