title: easier way to toggle a radio button with JavaScript/Ajax?
body: <p>I've set up radio buttons like this:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;hr /&gt;
  &lt;h2&gt;PhoneyTV Cabana&lt;/h2&gt;
  &lt;p&gt;
    &lt;input type="radio" id="phoneyRadio1" value="0" onclick="toggleParticlePower(phoneyID, phoneyPowerFunction, this.value)" name="led" /&gt;Off
    &lt;input type="radio" id="phoneyRadio2" value="1" onclick="toggleParticlePower(phoneyID, phoneyPowerFunction, this.value)" name="led" /&gt;On
  &lt;/p&gt;
  </code></pre>
  
  <p>there must be a simpler way of updating their stat than this:</p>
  
  <pre class="lang-js prettyprint-override"><code>$.getJSON(myURL, function(data) {
    state = (parseInt(data.result) == 1)
    if (state) {
      $('#phoneyRadio1').attr('checked', false);
      $('#phoneyRadio2').attr('checked', true);
    } else {
      $('#phoneyRadio2').attr('checked', false);
      $('#phoneyRadio1').attr('checked', true);
    }
  });
  </code></pre>
  
  <p>I tried just making the 'active' button highlighted, but I'm having trouble with that...</p>
  
  <p>What obvious shortcut am I missing?</p>