How to capture link clicks from dynamic html?

I get HTML from a server that I display in the app. Sometimes the HTML includes links, but instead of navigating to the URL on click I would like to do something else. How can this be accomplished?

Something akin to shouldStartLoadWithRequest in iOS webViews is what I’m looking for.

I’ve tried adding eventListeners directly to the DOM, with minimal success. There must be a cleaner way?