My question is similar to this one: Jquery hide() all elements with certain class except one. However in my case I have a certain parent.
I tried:
$('.slideNum').hide();
$('#marginRight ul li.selBar.slideNum').show();
The slideNum
that has selBar
as parent shouldn't be hidden, but it does!
Unlike the popular answer I didn't use "not" because the condition is for the parent and not for the element itself.