I am trying to execute multiple functions in a sequence when the user does a click on a button.
The problem I am having is that if I place one function after the other like this :
nextTooltipButton.onclick = function () {
if (self._introItems.length - 1 != self._currentStep) {
_nextStep.call(self);
}
$("#contenedorPage").scrollLeft(0);
$("#contenedorPage").trigger("scroll");
};
They execute either at the same time or the second one does not execute.
I come from c# where you can add various controllers (functions) to an event and they will be executed in the order in which you added them to the event.
Is there a way of doing something similar in Javascript?