📌  相关文章
📜  为什么 querySelectorAll 不允许 addEventListeners - Javascript 代码示例

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

代码示例1
/* Adding animation to a class called home */

const home= document.querySelector('.home')
const animate= document.querySelectorAll('.class_name');

animate.forEach(any_name =>
    any_name.addEventListener('click', function () {
        home.style.animation = "your animation";
}));