title: Get selected row value using javascript
body: <p>I have dynamically add the table on html button click. Add the teamname,teamid,radio button.</p>
  
  <p>HTML attributes:</p>
  
  <pre><code>&lt;input type="button" value="Generate a table." onclick="generate_table()"&gt;
  </code></pre>
  
  <p>Javascript function :</p>
  
  <pre><code>function generate_table() 
  {
      var body = document.getElementsByTagName("body")[0];
      var tbl = document.createElement("table");
      var tblBody = document.createElement("tbody");
      var teamrecord = "test";
      for (var i = 0; i &lt;  teamrecord.length; i++) {
          var row = document.createElement("tr");
  
          var cell = document.createElement("td");
          var cell1 = document.createElement("td");
          var cell2 = document.createElement("td");
  
          var cellText = document.createTextNode("teamrecord");
          var cellId = document.createTextNode("teamid");
          var radio = document.createElement("INPUT");
          radio.setAttribute("type", "radio");
          radio.setAttribute("name", "radio");
  
  
          cell.appendChild(cellText);
          cell1.appendChild(cellId);
          cell2.appendChild(radio);
  
          row.appendChild(cell);
          row.appendChild(cell1);
          row.appendChild(cell2);
  
          tblBody.appendChild(row);
      }
      tbl.appendChild(tblBody);
      body.appendChild(tbl);
  
  }
  </code></pre>
  
  <p>4 rows with 3 columns will generate on the button click , Now i need to get the details on the radio button click. </p>
  
  <p>If i select the radio button from the first row i need to show the teamid in alert box? how can I achieve this in javascript?</p>