Jquery bind doesnt work on AJAX loaded HTML

Posted by atif089 on Stack Overflow See other posts from Stack Overflow or by atif089
Published on 2010-05-29T15:17:14Z Indexed on 2010/05/29 15:22 UTC
Read the original article Hit count: 232

Filed under:
|
|
|

Hi,

This is my jquery code

jQuery(document).ready (function() {

   // post
    $('.post').bind('mouseenter mouseleave', function() {
        $(this).filter('.btn').toggleClass('hidden');
    });


});

It works great on a normal document. but When I load some HTM: (i.e some divs with .post attributes) using ajax and embed it into my DOM.

The above code doesnt work with those divs.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX