I have a table with a dozen rows, one of which is:
<TR><TD>
<B>Order Date</B> </TD><TD> [foo] </TD></TR>
<TR><TD>
and i want to assign the value of the last cell to a var.
thx
I have a table with a dozen rows, one of which is:
<TR><TD>
<B>Order Date</B> </TD><TD> [foo] </TD></TR>
<TR><TD>
and i want to assign the value of the last cell to a var.
thx
Your question is somewhat unclear.
You can get the last child of a row for which the first child contains Order Date
like this:
$('tr:has(td:first-child:contains("Order Date")) td:last-child').text()
try:
var text = $('td:contains("Order Date")').parent().children('td:last').text();
cleaner:
var cellText = $('td:contains("Order Date")').nextAll(':last').text();