i have this:
<div class="selection">
<a class="current" href="#">1</a>
<div class="class">text</div>
<a href="#">2</a>
<div class="class">text</div>
<a href="#">4</a>
<div class="class">text</div>
<a href="#">5</a>
</div>
i want to select the very next a element after a.current.
I did this, but it doenst work.
…
$(".selection a.current").next("a").hide();
i also tried
$(".selection").children("a.current").next("a").hide();
…
Arent all the a´s inside .selection siblings and therefore be accesable with the next() selector? I wonder, because it works when i remove the div elements between them.
Would be great if someone knows why this is not working ;).
From jQuery API browser:
That’s not the immediately following sibling. You could try using
nextAlland adding a:firstselector: