My javascript
$(".controls").click(function(event) {
var div = $(event.target).parents(".controls");
var a = $(div).find("tr .select");
return false;
});
And html
<div id="grid1" class="controls">
<a href="/projekt/create">Add</a>
<a href="/projekt/edit">Edit</a>
</div>
<div id="grid2" class="controls">
<a href="/uloha/create">Add</a>
<a href="/uloha/edit">Edit</a>
<table>
<tr id="1"></tr>
<tr id="2" class="select"></tr>
<tr id="3"></tr>
</table>
</div>
I'd like to select the first TR which has class select
.
I've tried
var a = $(div).find("tr:first .select");
or
var a = $(div).find("tr .select:first");
but none of them worked.