title: How to find rowindex when clicked a button in table
body: <p>I want to find row which clicked button in.</p>
  
  <pre><code>&lt;table&gt;
    &lt;tr&gt;
      &lt;td&gt;foo 1&lt;/td&gt;
      &lt;td&gt;&lt;input  type="button" value="Remove" id="remove1"/&gt; &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;foo 2 &lt;/td&gt;
      &lt;td&gt;&lt;input  type="button" value="Remove" id="remove2"/&gt; &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>My table struct is like above.  Normally I can us buttonid to get row index. But If I remove a row (tr) another row index changes. For example:</p>
  
  <p>If I remove first row with jQuery, second row index changes as 0 then I cannot use button's id. (remove - 2 )</p>
  
  <p>Well I think that I must use parent function but it doesn't work.</p>
  
  <pre><code>var elem = $('#remove2');
  alert(elem.parent()[0].sectionRowIndex);
  </code></pre>
  
  <p>I tried this one but doesn't work. I need row index that clicked button in the row.</p>
  
  <p>I hope that I explained my issue.</p>