I've got a function that adds or removes a class when clicked:
$('button').on('click', function(){
// do stuff
});
However, I am also loading stuff with AJAX. When I load the AJAX, the click event does not work with the newly loaded content.
Is there a way I can get the function to work globally, rather than have to repeat it within the callback? Would it be something like change
or live
?