Answers for "why querySelectorAll doesn't let addEventListeners"

1

why querySelectorAll doesn't let addEventListeners

/* 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";
}));
Posted by: Guest on March-07-2021

Code answers related to "why querySelectorAll doesn't let addEventListeners"

Code answers related to "Javascript"

Browse Popular Code Answers by Language