[Solved] join 2 same almost same function into 1 [closed]


I’m guessing you want to call two functions on onchange. Try this:

newcell.childNodes[0].setAttribute("onchange",function(){
    showUser(this.value,"+xx+");
    secondFunction();
});

or since you tagged this jQuery, do it the jQuery way:

$(newcell.childNodes[0]).change(function(){
    showUser(this.value,"+xx+");
    secondFunction();
});

1

solved join 2 same almost same function into 1 [closed]