Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

JavaScript: Exclude items from document.querySelectorAll

var items = document.querySelectorAll('.x .y .z');

Open in new window

That selects all elements with the matching CSS pattern.  I do NOT want to select any elements that contain the class: "skip".

So this should match:
<div class="x"><p class="y"><em class="z"></em></p></div>

But this should NOT match:
<div class="x"><p class="y"><em class="z skip"></em></p></div>

How can this be done with JavaScript or jQuery?
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial