I'm trying to make a page with a box in three steps, and each step needs to be loaded by ajax, the steps change after each click in the button "next". I'm changing the class of the button for each step so I can load the next, do not know if there is a better method. but when I click to go to the second step carries me the first step.
/**** THIS WORK FINE *****/
// First Click on Next Button load first step
$('.next-button').on('click', function(){
$('.first-step').load('includes/selecione-torcida.html');
$('.next-button').addClass('next-torcida');
});
/**** THIS DON'T WORK *****/
// Second Click on Next Button load second step but in the class "next-torcida"
$('.next-torcida').on('click', function(){
$('.first-step').load('includes/selecione-amigos.html');
});