Skip to content

Instantly share code, notes, and snippets.

@norcross
Created October 20, 2014 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save norcross/e69ba895176248bc5221 to your computer and use it in GitHub Desktop.
Save norcross/e69ba895176248bc5221 to your computer and use it in GitHub Desktop.
example of using on.click with dynamic elements
// the idea being that the container div exists outside of the
// dynamic element, and the anchor link is loaded.
jQuery( 'div.container' ).on( 'click', 'a.dynamic-element' function (){
// do your thing here
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment