$('#myTable tr:last'); i get a tr content(without tr tag). how can i get tr attribute? I can’t. then tried to get attribute er from first td on clicked row. and now same problem.
$('#myTable tr').click(function() {
var State = $(this).find("td:first-child").attr("er"); // this code is false
alert(State);
});
My HTML
<table width="600px" cellspacing="0" border="1" id="myTable">
<tr>
<th>
...
</th>
<th>
...
</th>
<th>
...
</th>
<th>
...
</th>
<th>
...
</th>
<th>
!
</th>
</tr>
<tr bgcolor="#484848">
<td width="152px;" class="textField" er="editable">
<input type="text" value="" />
</td>
<td width="350px;">
<textarea cols="40" rows="3"></textarea>
</td>
<td>
<select disabled="disabled">
//options
</select>
</td>
<td width="152px;">
<input type="text" />
</td>
<td>
<input type="checkbox" />
</td>
<td>
</td>
</tr>
</table>
This works fine for me
First event prints the first td in the last tr on click on the last tr.
Second event prints the class attribute in the last tr on click on the last tr.