I am experiencing some weird behavior in jQuery (v1.7):
I am trying to set an event listener to an element that actually gets replaced at some point via ajax.
$(document.getElementById('element')).live('click', function() {
// do something on click
});
while this works fine with other methods, the live method refuses to run. when replacing this with the native jQuery selector it works. Why?
$("#element").live('click', function() {
// do something on click
});