I have a table:
<table>
<thead>
<tr>
<td>some1</td>
......
<td>some2</td>
<th>count</th>
<th>EditCount</th>
</tr>
</thead>
<tbody>
<tr>
<td>some1</td>
......
<td>some2</td>
<td>25</td>
<td><input type='text' value='1'/></td>
</tr>
<tr>
<td>some1</td>
......
<td>some2</td>
<td>35</td>
<td><input type='text' value='3'/></td>
</tr>
How to get td value in left side from input in each row, for example when user clicked on this input?
(Note from “left side” i took this to mean the first
tdie the leftmost one)Try this :
Uses the .change() method in jQuery (this could be
focusorbluretc). Uses the selectortd:firstto get the firsttdand sets the context to the current objects (input') parenttr`Working example here
Update
To get the previous
td(ie with values25or35use :This gets the .parent()
tdand then the .prev()tdWorking example here