title: javascript checkboxes: use a button to change a group to checked
body: <p>I've been using this (and it works/worked) with a regular web page, but when I try to attach Jquery (v1.9.1 + jquery mobile v 1.2.0 -- for button styling and other functionality) it seems to select the right objects (ran a console.log to see what item was being grabbed in the array) but it doesn't update the checkbox in the page (make it checked) despite returning a value of "true". It also does the same thing when I just do the basics in my jsFiddle here: <a href="http://jsfiddle.net/artcase_1/6sasA/2/" rel="nofollow">http://jsfiddle.net/artcase_1/6sasA/2/</a></p>
  
  <pre><code>function checkUncheck(name, setTo) {
  
  
      var c = document.getElementsByName(name);
  
      for (var i = 0; i &lt; c.length; i++) {
  
          if (c[i].type == 'checkbox' || c[i].checked == 'false') {
  
              c[i].checked = setTo;
          }
      }
  }
  
  &lt;!-- in the body: --&gt;
  &lt;div data-role="fieldcontain"&gt;
      &lt;fieldset data-role="controlgroup" data-type="horizontal"&gt;
          &lt;legend&gt;choose a level to view&lt;/legend&gt;
          &lt;input name="colors" type="checkbox" class="custom"
          id="redbtn" value="red" checked="checked" /&gt;
          &lt;label for="redbtn"&gt;High&lt;/label&gt;
          &lt;input name="colors" type="checkbox" class="custom" id="yellowbtn"
          value="yellow" /&gt;
          &lt;label for="yellowbtn"&gt;Med&lt;/label&gt;
          &lt;input name="colors" type="checkbox" class="custom" id="bluebtn"
          value="blue" /&gt;
          &lt;label for="bluebtn"&gt;Low&lt;/label&gt;
      &lt;/fieldset&gt;
  &lt;/div&gt;
  &lt;input name="Show_all_btn" type="button" id="showall" onclick="checkUncheck('colors','true')"
  value="check all" /&gt;
  </code></pre>