Cannot get jQuery click handler to fire on ajax loaded element

Posted by frosty on Stack Overflow See other posts from Stack Overflow or by frosty
Published on 2010-01-27T12:06:19Z Indexed on 2010/04/25 1:03 UTC
Read the original article Hit count: 299

Filed under:
|
|

"MyParentPage.htm" uses the load function of jquery to load('myDiv.htm') //

myDiv.htm only contains:

<a href="#" class="bt-cbox">Click me</a>

I have the following in "MyParentPage.htm"

$(document).ready(function() {    
    $(".bt-cbox").click(function() {    
        alert("handler hit");
    });
});

Why is the my alert not being hit

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery