I'm trying to select and click on elements with the class ".foo" that do not contain the class ".bar".
I'd like to use code like this but it isn't working:
var inputs = document.getElementsByClassName('foo:not(bar)');
for(var i=0; i<inputs.length;i++) {
inputs[i].click();
}
Thanks for help!
You can try to use
querySelectorAll
:Or as you have
jquery
in your tags: