You may also need to use $.trim() to get exact text without whitespace.
$.trim($(this).find("#chargeTD").text())
It worked form me:
HTML:
<tr class=""id="tr_id" >
<td class="l_id">7283630222</td>
</tr>
<tr class=""id="tr_id" >
<td class="l_id">7276684022</td>
</tr>
<p id="leadID">-lead id here-</p>
jQuery:
$(document).ready(function() {
$("tr#tr_id").click(function() {
$("#leadID").text($(this).find("td.l_id").text());
});
});
Post a Comment for "Getting A Value Of Td Of A Selected Tr In Jquery"