0.0.4 • Published 8 years ago
@yuheiy/childnode-ponyfill v0.0.4
ChildNode ponyfill
ChildNode ponyfill.
Install
npm i @yuheiy/childnode-ponyfillUsage
import {replaceWith} from '@yuheiy/childnode-ponyfill'
const oldElement = document.querySelector('#old')
const newElement = document.createElement('div')
replaceWith(oldElement, newElement)API
before(childNode, ...nodes)
export declare const before: (childNode: Element | CharacterData | DocumentType, ...nodes: (string | Node)[]) => void;Same API with ChildNode.before().
after(childNode, ...nodes)
export declare const after: (childNode: Element | CharacterData | DocumentType, ...nodes: (string | Node)[]) => void;Same API with ChildNode.after().
replaceWith(childNode, ...nodes)
export declare const replaceWith: (childNode: Element | CharacterData | DocumentType, ...nodes: (string | Node)[]) => void;Same API with ChildNode.replaceWith().
remove(childNode)
export declare const remove: (childNode: Element | CharacterData | DocumentType) => void;Same API with ChildNode.remove().
License
MIT