Is there any way to use the onclick
html attribute to call more than one JavaScript function?
var btn = document.querySelector('#twofuns');
btn.addEventListener('click',method1);
btn.addEventListener('click',method2);
function method2(){
console.log("Method 2");
}
function method1(){
console.log("Method 1");
}
Pramod Kharade-Javascript
You can achieve/call one event with one or more methods.