Question

I have this code that use live method, and it works in Opera and Chrome:

 $(".dynamicaly_created_div").live("click",function(){
    $(event.target).parent().remove();
 });

But not in the FF. So i tried to replace "live" with "on" (i read somwhere that live is deprecated). But then, this does not work in any browser.

Is ther any solution for this?

Was it helpful?

Solution

Have you tried passing the event into the function?

$(".dynamicaly_created_div").live("click",function(e){
    $(e.target).parent().remove();
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top