Welcome to WebmasterWorld Guest from 54.145.235.72

Forum Moderators: open

can I delete the parent after the child.

   
7:40 pm on Dec 2, 2011 (gmt 0)



This deletes the child. "event.target.parentNode.removeChild(event.target);" . Event target is an image that is wrapped within a "p" element. Perhaps learn the parentNodes id before the delete?
9:28 pm on Dec 2, 2011 (gmt 0)

5+ Year Member



If you're deleting the parent you don't have to delete the child first.

event.target.parentNode.parentNode.removeChild(event.target.paretNode);


You could also probably use "this" instead of "event.target".

this.parentNode.parentNode.removeChild(this.paretNode);
12:59 pm on Dec 3, 2011 (gmt 0)



Thanks. That worked.
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month