📅  最后修改于: 2022-03-11 14:47:48.559000             🧑  作者: Mango
const elements = document.querySelectorAll('.foo');
for (const element of elements) {
element.addEventListener('click', doSomething);
}