rselvaganesh rselvaganesh - 3 months ago 7x
Javascript Question

jquery to select second row column using first row column <td> in table

I want to select second row second column using first row second column tag in html table


<td>Row 1</td>
<td id="amount-paid">$1.00 USD</td>
<td>Row 2</td>
<td>$2.69 USD</td>

now i need to change the Row 2 second column value to "Paid" message.
This i need to do by using the first row second column id "amount-paid".

i tried the below code but it not worked

$('#amount-paid td:eq(2)').text('Paid');

It looks like this


Try following:

$('#amount-paid td:eq(1)').text('Paid');

How about these?

$('table tr:eq(1) td:eq(1)').text("Paid")