internet explorer remove element from dom

To use the func­tion­al­ity of childNode.remove() API on inter­net explorer, you have to use the fol­low­ing polyfill:


( arr => { arr.forEach( item => { item.remove = item.remove || () => { this.parentNode.removeChild(this) } }) }) ( [Element.prototype, CharacterData.prototype, DocumentType.prototype] )

Ref­er­ence:

  • https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/remove()/remove().md

You may also like...