bind dynamically added links to pushPage
-
How would I bind links added to the DOM to a pushPage method?
I’m populating parts of the page dynamically, the content being populated, I’d like to bind all links in this new content to a pushPage method.
-
You would want to set the link’s
onclick
property:document.querySelector('#link').onclick = () => navigator.pushPage('some-page.html')