Given some set of jQuery objects, as well as a subset of this set, is there a method that will return a substring inverse ?
If the answer is “ No, ” is there a way to avoid the second choice in order to get the opposite subset?
Explanatory example:
<ul>
<li class="subset"></li>
<li class="subset"></li>
<li class="inverse"></li>
<li class="inverse"></li>
</ul>
First I want to do something with everything <li>, and then something only .subsetand finally something else only .inverse:
$('li').css('background-color','blue')
.filter('.subset')
.css('color','black')
.inverse()
.css('color','white');
I know this can be easily done with help .end().filter('.inverse'), but suppose the selector was actually big and nasty , and running it twice would be a big hit . What then?
API, jQuery , , - ( .andSelf() , ...).