UNPKG

polyfill-service

Version:
12 lines (10 loc) 411 B
Document.prototype.remove = Element.prototype.remove = function remove() { if (this.parentNode) { this.parentNode.removeChild(this); } }; // Not all UAs support the Text constructor. Polyfill on the Text constructor only where it exists // TODO: Add a polyfill for the Text constructor, and make it a dependency of this polyfill. if ("Text" in this) { Text.prototype.remove = Element.prototype.remove; }