Match Elements Even When DOM Changes


/ Published in: jQuery
Save to your folder(s)

If you want to trigger an event on an matched element and that element may be introduced into the DOM from an Ajax request, you can still match against it by using the livequery plugin and the following code.


Copy this code and paste it in your HTML
  1. $('.myClassToMatchAgainst').livequery(function(event) {
  2. //do this
  3. });

URL: http://docs.jquery.com/Plugins/livequery

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.