📜  for...of...loop 和 NodeLists - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:48.559000             🧑  作者: Mango

代码示例1
const elements = document.querySelectorAll('.foo');

for (const element of elements) {
    element.addEventListener('click', doSomething);
}