I am using WordPress with the events calendar plugin. I have written some JavaScript to manipulate the DOM on the view that publishes the courses in a grid. The code works fine until the user paginates. Looking at the dev tools, I can see a xhr request, so can assume the pagination happens via ajax.
How do I make sure the code works when the user paginates? I have tried using the jQuery ajax.Complete event.
All my code is wrapped in one function called
courseElements();
Thanks