title: Unable to get selected row index of gridview in javascript
body: <p>I have got a gridview with certain rows/columns and an edit button for each row. When the edit button is clicked, it opens a popup window with a textbox and a button. I want to know the index of the selected row on click of the button inside the popup. I added code like so</p>
  
  <pre><code>var table = document.getElementById('&lt;%= gvTimeSlots.ClientID%&gt;');
  var Row;
  for (var i = 1; i &lt; table.rows.length; i++) {
      Row = table.rows[i];
      alert(Row);
  }
  </code></pre>
  
  <p>But the alert gives me "Undefined". What am I missing here?</p>