title: How can I set html radio value from javascript?
body: <p>How can I set html radio value from javascript ??
   I try this code </p>
  
  <pre><code>&lt;script type="text/javascript" src="jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
  $.getJSON("getquestion.php",function(result)
  {
          //set radio value
      //$("#choice").html(result.test_choice_a);
      //$("#choice").val(result.test_choice_a);
      //$("#choice").html(result.test_choice_b);
      //$("#choice").val(result.test_choice_b);
      //$("#choice").html(result.test_choice_c);
      //$("#choice").val(result.test_choice_c);
      //$("#choice").html(result.test_choice_d);
      //$("#choice").val(result.test_choice_d);
      document.testform.choice[0].value = result.test_choice_a;
      document.testform.choice[1].value = result.test_choice_b;   
      document.testform.choice[2].value = result.test_choice_c;   
      document.testform.choice[3].value = result.test_choice_d;
  }
  &lt;/script&gt;
  
  &lt;input type="radio" name="choice" id="choice" &gt;&lt;br&gt;
  &lt;input type="radio" name="choice" id="choice"&gt;&lt;br&gt;
  &lt;input type="radio" name="choice" id="choice"&gt;&lt;br&gt;
  &lt;input type="radio" name="choice" id="choice"&gt;&lt;br&gt;
  </code></pre>
  
  <p>but it didn't work.</p>
  
  <p>How can I set it ?? help me please.</p>