how to call a function with arguments on event listener javascript
element.addEventListener("click", () => {
functionYouWantToCall(yourArguments);
});
how to call a function with arguments on event listener javascript
element.addEventListener("click", () => {
functionYouWantToCall(yourArguments);
});
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);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us