How to execute a trigger after another trigger

0

How to make the second trigger only run after the first trigger loads the html completely?

$('#element-one').trigger('click');
// aguardar o primeiro ecento (carrega um html via ajax)

$('#element-two').trigger('change'); // só deveria ser executado depois do primeiro evento
    
asked by anonymous 02.05.2016 / 02:09

1 answer

0

You can use click() to point to the first click, and then second click using trigger() :

$("#target").click(function() {
    $( "#segundoElemento" ).trigger("click");
});
  

I happened to have seen and there is even an example of this in trigger() documentation

    
02.05.2016 / 03:05