+ 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...
0
Hi ââÒ
Yes, see below
x.addEventListener(âclickâ, function() {
function1();
function2();
}