Dynamically added div is not deleting <div> parent block?

Hi there

This is my jsfiddle.net
http://jsfiddle.net/vngx/regntoey/29/

In this when I am clicking on delete button of newly added group then whole block is not deleting.
I am expecting that particular block should delete but that is deleting only to itself.

(I know this is because they are on separte table)

How do I make this working?

I’m not sure if this is what you meant but I assume you want to delete the table.

If so change .parent() to .closest(‘table’) instead

if(sure){
        $(this).closest('table').remove();
}

Thanks @PaulOB

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.