📌  相关文章
📜  javascript 如何在 querySelectorall 中传递多个选择器 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:03.638000             🧑  作者: Mango

代码示例1
Is it possible to make a search by querySelectorAll using multiple unrelated conditions?

Yes, 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:

var list = document.querySelectorAll("form, p, legend");
...will return a list containing any element that is a form or p or legend.