This is my code:
const start = document.querySelector('#start');
function AnimationCaller(elParam, name, duration, count, fillMode){
const element = document.querySelector(elParam);
element.style.animationName = name;
element.style.animationDuration = duration;
element.style.animationIterationCount = count;
element.style.animationFillMode= fillMode;
}
AnimationCaller('.circle-1', 'bounce', '3s', 'infinite');
AnimationCaller('.right-back-foo', 'scale', '6s', 'infinite');
start.addEventListener('click', AnimationCaller('.landing-page', 'slide', '2s', null, 'forwards'))
I want the "AnimationCaller" function to run when I click on the "start" object. However, when the page is loaded, "AnimationCaller" works automatically. What is the reason for this and how can I fix it?