Skip to content Skip to sidebar Skip to footer

Jquery To Select Second Row Column Using First Row Column In Table

I want to select second row second column using first row second column tag in html table. Example:
Row 1).text('Paid');

How about these?

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

or

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

Solution 2:

Try using innerHTML instead of text like this:

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

Solution 3:

Using jQuery .eq()

$('table tr').eq(1).find('td').eq(1).text('Paid');
<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><table><tr><td>Row 1</td><td>$1.00 USD</td></tr><trid="amount-paid"><td>Row 2</td><td>$2.69 USD</td></tr></table>

Post a Comment for "Jquery To Select Second Row Column Using First Row Column

In Table"