Answers for "addeventlistener call function with arguments"

1

how to call a function with arguments on event listener javascript

element.addEventListener("click", () => {
    functionYouWantToCall(yourArguments);
});
Posted by: Guest on January-08-2021
0

myFunction with param on addEventListner

var someVar = 32;//Sample value 
var someEle = document.getElementById("someID");//Sample Element
someEle.addEventListener("click", function(){
   myFunction(someVar);// <- There use your function with param in brackets
}, false);
Posted by: Guest on August-27-2021

Code answers related to "addeventlistener call function with arguments"

Code answers related to "Javascript"

Browse Popular Code Answers by Language