what is the next best thing to use when you want to select the next li item, but not the one that has someClassName. The not selector returns an empty array!
or is this a case off using filter?
<ul class="items">
<li class="first">pickle</li>
<li class="someClassName">tomato</li>
<li>chicken</li>
<li>cocosnut</li>
</ul>
var current = $('ul.items li.first');
var next = current.next(':not(li.someClassName)');
thanks, Richard
next
only selects the next sibling of the selected element. You can use nextAll
method:
var next = current.nextAll(':not(.someClassName)').first();
Note that your markup is not valid.