Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

element.parentNode.removeChild() method not working in internet explorer

I am trying element.parentNode.removeChild() method. Its working fine in Firefox but not working in IE 9.

Can anyone please tell how to remove an element in IE using javascript?

Thanks...

like image 977
Shekhar Avatar asked Dec 20 '22 16:12

Shekhar


1 Answers

Use removeChild function in the parentNode of the element.

If element is the node that needs to be removed, then do this:

element.parentNode.removeChild(element)
like image 67
Filling The Stack is What I DO Avatar answered Jan 21 '23 09:01

Filling The Stack is What I DO