Answer the question
In order to leave comments, you need to log in
A question for the JQuery guru - why doesn't such a tricky selector work?
There is this html:
<tr><br/>
<td onclick="$(':parent~tr.dsc:first',this).toggle()">...</td><br/>
<td>...</td><br/>
</tr><br/>
<tr class="dsc"><br/>
...<br/>
</tr><br/>
Answer the question
In order to leave comments, you need to log in
$(':parent', elem)
looks for _inside_ the element of its parent, this is not correct. Make it easier:$(this).parent().next().toggle();
It will be faster (no parsing of selectors) Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question