Search code examples
javascriptjqueryjquery-selectors

How to select the inverse of the selection


I am successful in selecting the first <li> of the <ul>.

I want to select the remaining of the <li> except the current selected <li> . i.e., (inverse).

How can I select it?

Edited as per request

var newEle = $(str); //str contains a <li> i.e., <li>Some content</li>
$(newEle).hide();

Solution

  • http://api.jquery.com/not-selector/ Solves my problem