Reputation: 1
My Table is Like This, I want to Get the value it is between <a>
and </a>
,Any one can help me please,Thank you.
<table id="depart_me" class="tbl1" cellspacing="0" cellpadding="5" border="0" width="100%">
<tbody>
<tr class="rower bgyellow">
<td width="4"> </td>
<td width="30">
</td>
<td colspan="4">
Hai
</td>
<td bgcolor="#e2fdba" style="-moz-border-radius: 10px 10px 10px 10px; text-align: center; width: 100px;">
<div class="d_totprice" align="center" style="margin-left: 10px; float: left;">
<a class="farebreakup" href="javascript:void(0);">5996</a>
</div>
</td>
</tr>
</tbody>
</table>
Upvotes: 0
Views: 113
Reputation: 9825
Use the following:
var value_of_anchor = $('a.farebreakup','#depart_me').text();
Hope it helps.
Thanks to Šime Vidas for the inspiration and to ipr101 for pointing out the typo!
Upvotes: 1
Reputation: 24236
Using jQuery, try this -
$("table#depart_me a.farebreakup").text()
As per Šime Vidas's comment below, the following selector would be more efficient -
$('a.farebreakup','#depart_me').text()
Demo - http://jsfiddle.net/wdwB3/
Upvotes: 0