Element Object doesn’t support property or method ‘remove’ In IE

Hi, There:

Happy Thanksgiving!  Drop a few a lines here to record an IE issue, from a version of angularJS datetime picker. The error only happens in IE:

Object doesn’t support property or method ‘remove’. The Code related were something like this:

el.remove();

It is due to that IE doesn’t support remove() function for DOM element.  But if you change to the following, things work much better!

el.parentNode && el.parentNode.removeChild(el);

Hopefully this will help anyone is scratching their heads for this IE issue that doesn’t happen in Chrome or Firefox.

Best,

-Tony

 

 

Advertisements

One thought on “Element Object doesn’t support property or method ‘remove’ In IE

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s