title: How to find cell text by row index by jQuery
body: <p>I have two rows of an html table:</p>
  
  <pre><code>&lt;table id="mytable"&gt;
  &lt;tbody&gt;
  &lt;tr&gt;&lt;td rowspan="2"&gt;Row text&lt;/td&gt;&lt;td&gt;first cell&lt;/td&gt;&lt;td&gt;second cell&lt;/td&gt;&lt;td&gt;third cell&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;
     &lt;td&gt;&lt;input type="text" value="" /&gt;&lt;/td&gt;
     &lt;td&gt;&lt;input type="text" value="" /&gt;&lt;/td&gt;
     &lt;td&gt;&lt;input type="text" value="" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I have to get the text of respective cell from first row while click on any input field of second row. As for example, if any user clicks on first input field of second row, 'first cell' should be get by jQuery. I am trying to achieve this as below:</p>
  
  <pre><code>$('#mytable tbody tr td input[type="text"]').click( function(){
     var thisRow = $(this).closest('tr').index();
     var thisCell = $(this).closest('td').index();
     var upRow = thisRow-1;
     var firstCellText = upRow.find('td:eq(thiscell+1)').text();
  alert(firstCellText);
  });
  </code></pre>
  
  <p>but the text is not getting as expected. How to get the text?</p>