I have a table like below
<table>
<tr>
<td>Item1</td><td>Price-100</td><td>1</td><td><input type="button" value="add one"/>
</tr>
<tr>
<td>Item2</td><td>Price-120</td><td>4</td><td><input type="button" value="add one"/>
</tr>
<tr>
<td>Item3</td><td>Price-90</td><td>2</td><td><input type="button" value="add one"/>
</tr>
</table>
When I click on a button, I want to increment the value of 3rd cell of the row incremented by 1. How can I get that value of that cell which is in the row in which the button was clicked.
I tried to create with id attribute with the <tr> tag of the table.
var tableRow = $('#tr1').find('td');
var origVal = parseInt($(tableRow[2]).text());
origVal+=1;
$(tableRow[2]).text(origVal);
But is it possible to get without adding id to the table record?
if you can use jQuery