jquery - Get attr value of first child -
i have follwing code assigning onclick <tr>
row:
$("#tbldepartment tr").click(function() { alert($(this).eq(1).attr("field")); });
my html code here:
<tr class="treven" id="trdepartment4"> <td field="id" style="display: none;" width="50px">4</td> <td field="dept_nm" width="100%">bid department</td> </tr>
what tget first child's innerhtml. how can that?
you want this
$("#tbldepartment tr").click(function() { alert($(this).children('td').first().html()); });
this show content looking :)
Comments
Post a Comment