title: Not getting default checked on radio button
body: <p>I have 10 radio buttons with unique name and these radio buttons are divided into two div. I mean each div have 5 radio buttons and i want to show only one div at a time with first radio button checked. what i want is visible div should have first radio button checked by default. but please note all radio buttons have unique name on a same page. </p>
  
  <p>Below is my code for reference.</p>
  
  <pre><code>&lt;style&gt;
  #secondopt, #firstopt { display: none;}
  &lt;/style&gt;
  
  &lt;script&gt;
  function checkme(){
  if (document.getElementById("opt1").checked == true){
  document.getElementById("firstopt").style.display = "block"
  document.getElementById("secondopt").style.display = "none";
  }
  if (document.getElementById("opt2").checked  == true){
  document.getElementById("firstopt").style.display = "none"
  document.getElementById("secondopt").style.display = "block";
  }
  }   
  &lt;/script&gt;
  
  &lt;form name="form1"&gt;
  &lt;label&gt;&lt;input type="radio" name="opt" id="opt1" onclick="checkme()" /&gt; First opt&lt;/label&gt;
  &lt;label&gt;&lt;input type="radio" name="opt" id="opt2" onclick="checkme()" /&gt; Second Opt&lt;/label&gt;
  &lt;div id="firstopt"&gt;
  &lt;label&gt;&lt;input type="radio" name="items" value="data1" /&gt;Item 1&lt;/label&gt;
  &lt;label&gt;&lt;input type="radio" name="items" value="data2" /&gt;Item 2&lt;/label&gt;
  &lt;label&gt;&lt;input type="radio" name="items" value="data3" /&gt;Item 3&lt;/label&gt;
  &lt;label&gt;&lt;input type="radio" name="items" value="data4"/&gt;Item 4&lt;/label&gt;
  &lt;label&gt;&lt;input type="radio" name="items" value="data5"/&gt;Item 5&lt;/label&gt;
  &lt;/div&gt;
  &lt;div id="secondopt"&gt;
  &lt;label&gt;&lt;input type="radio" name="items" value="data6"/&gt;Item 6&lt;/label&gt;
  &lt;label&gt;&lt;input type="radio" name="items" value="data7"/&gt;Item 7&lt;/label&gt;
  &lt;label&gt;&lt;input type="radio" name="items" value="data8"/&gt;Item 8&lt;/label&gt;
  &lt;label&gt;&lt;input type="radio" name="items" value="data9"/&gt;Item 9&lt;/label&gt;
  &lt;label&gt;&lt;input type="radio" name="items" value="data10"/&gt;Item 10&lt;/label&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>How to achive this?</p>