TIL Using pseudo-classes in your querySelector!
POSTED ON:
TAGS: css javascript
I didn't know this, but you can use pseudo-classes in your querySelector!
Let’s say you want to ignore buttons with the
.tuna
class. You can use the:not()
pseudo-class in your selector string, like this…
let notTuna = document.querySelectorAll('.sandwich:not(.tuna)');
Related TILs
Tagged: css