title: Select a radio button dynamically
body: <p>I need to select a radio button dynamically.</p>
  
  <p>i) I have created few radio buttons dynamically, i.e. in a function using:</p>
  
  <pre><code>function funcName()
  {
      Something.innerHTML = '&lt;input type = "radio" name = "rName" id = "1" /&gt;' + '&lt;input   type = "radio" name = "rName" id = "2" /&gt;' + '&lt;input type = "radio" name = "rName" id = "3" /&gt;';
  
  }
  </code></pre>
  
  <p>ii) I need to select a radio button dynamically, in another function:</p>
  
  <pre><code>function funcNAme(someVar)
  {
      document.getElementById(someVar).checked = true;
  }
  </code></pre>
  
  <p>But this does not work, i.e. the radio button doesn not get selected. However, 'disabled' works fine. 
  Also:</p>
  
  <pre><code>alert(someVar); 
  </code></pre>
  
  <p>returns the appropriate desired value.</p>