+ 3
if you use addEventListener() to register event handler function, you could add how many you want: x.addEventListener("click", function1); x.addEventListener("click", function2); (no need to create a third function to call your two others) if you use event attribute/properties, you must create a third function wich call each of the function you want to run on event: x.onclick = function(evt) { function1.call(this,evt); function2.call(this,evt); }; however, you are obviously not mandatory to bind 'this' object and/or event object...
23rd Jun 2021, 5:04 AM
visph
visph - avatar
0
Hi ℋℜҜ Yes, see below x.addEventListener(“click”, function() { function1(); function2(); }
23rd Jun 2021, 4:51 AM
Ollie Q
Ollie Q - avatar