Let’s face this situation:
<ul>
<li>data</li>
<li class="selector">data2</li>
<li class="selector2">data3</li>
</ul>
What i’m trying to do is match lis that either have selector class or have class attribute undefined, something like this:
jQuery(function($) {
$('.selector2').prevAll('li.selector OR li[class==""]');
});
So if I’m running prevAll() on the .selector2, it should return 2 list items. If i run it on .selector, it should return the first list item.
So is there a way to replace that OR … ?
PS: xpath may work for me too as i’m developing for modern browsers
DEMO
Adding in important comment from @pimvdb