I have two data attributes (let's call them data-foo && data-bar). And i'd like to do something like that document.querySelectorAll('[data-foo="hey"] **AND** [data-bar="ho"])
. I know how to do a OR but i can't find how to AND with selectors. Can you please help ?
Asked
Active
Viewed 424 times
0

Creep
- 300
- 3
- 12
-
3`document.querySelectorAll('[data-foo="hey"][data-bar="ho"]')` – Arun P Johny Feb 24 '17 at 08:44
-
1Since those are css selectors - http://stackoverflow.com/questions/2797091/css-and-and-or – Arun P Johny Feb 24 '17 at 08:45
-
1[Can I put logical operators in document.querySelectorAll? If so, how?](//stackoverflow.com/q/36544941) – Tushar Feb 24 '17 at 08:45
-
Thanks @ArunPJohny that did the trick. – Creep Feb 24 '17 at 08:55