I am working on a page where the selected item among a list is characterized by NOT having a given class. Something like the following:
-
You can use the :not() pseudo, that's exactly what you need for this job.
https://developer.mozilla.org/en-US/docs/Web/CSS/:not
So all you have to do is
document.querySelector(".a:not(.b)")
But also consider using jQuery, like
$(".someclass").not(".another")
Stansard querySelector is faster, jQ is more readable.