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. });


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.