How to delete the parent of an anchor tag using jQuery

Posted by Vinni on Stack Overflow See other posts from Stack Overflow or by Vinni
Published on 2010-04-17T13:50:21Z Indexed on 2010/04/17 13:53 UTC
Read the original article Hit count: 333

Filed under:
|

Hello guys,

I have an requirement of deleting the parent element of an anchor tag. I am adding div and anchor inside it dynamically. below is my code, Please help me out

  $("<div>"+offer+"<a href='javascript:deleteOrder(this.parent)'>X</a></div>").appendTo($('#resultTable #resultRow td')[selectedOrder-1]);


function deleteOrder(obj)
        {
            $(obj).parent().remove();
        }

© Stack Overflow or respective owner

Related posts about html

Related posts about jQuery