javascript how to pass more than one selector in queryselectorall

Solutions on MaxInterview for javascript how to pass more than one selector in queryselectorall by the best coders in the world

showing results for - "javascript how to pass more than one selector in queryselectorall"
Celina
10 Oct 2017
1Is it possible to make a search by querySelectorAll using multiple unrelated conditions?
2
3Yes, because querySelectorAll accepts full CSS selectors, and CSS has the concept of selector groups, which lets you specify more than one unrelated selector. For instance:
4
5var list = document.querySelectorAll("form, p, legend");
6...will return a list containing any element that is a form or p or legend.