I have multiple pages in my jQuery mobile app and the "infamous" back button is being inserted dynamically; what I mean is that when the main page loads the back button does not show up on the second page in the DOM. As soon as I navigate to the second page jQuery mobile inserts the back button.
I am using the
data-add-back-btn="true"
on the header div of the page to get the back button.
I want to run some of my own functions when the user clicks on the back button. My question is how can I target this dynamically generated content via JavaScript or jQuery?