function replaceElement(elem, replacement) {
    const prev = (replacement.prev = elem.prev);
    if (prev) {
        prev.next = replacement;
    }
    const next = (replacement.next = elem.next);
    if (next) {
        next.prev = replacement;
    }
    const parent = (replacement.parent = elem.parent);
    if (parent) {
        const childs = parent.children;
        childs[childs.lastIndexOf(elem)] = replacement;
        elem.parent = null;
    }
}
/**
 * Replace an element in the dom
 *
 * @category Manipulation
 * @param elem The element to be replaced
 * @param replacement The element to be added
 */
Replace an element in the dom
@category Manipulation
@param elem The element to be replaced
@param replacement The element to be added
Replace an element in the dom @category Manipulation @param elem The element to be replaced @param replacement The element to be added
function replaceElement(elem, replacement) {
    const prev = (replacement.prev = elem.prev);
    if (prev) {
        prev.next = replacement;
    }
    const next = (replacement.next = elem.next);
    if (next) {
        next.prev = replacement;
    }
    const parent = (replacement.parent = elem.parent);
    if (parent) {
        const childs = parent.children;
        childs[childs.lastIndexOf(elem)] = replacement;
        elem.parent = null;
    }
}
function replaceElement ( elem , replacement ) { const prev = ( replacement . prev = elem . prev ) ; if ( prev ) { prev . next = replacement ; } const next = ( replacement . next = elem . next ) ; if ( next ) { next . prev = replacement ; } const parent = ( replacement . parent = elem . parent ) ; if ( parent ) { const childs = parent . children ; childs [ childs . lastIndexOf ( elem ) ] = replacement ; elem . parent = null ; } }
Replace an element in the dom
 @category Manipulation
 @param elem The element to be replaced
 @param replacement The element to be added
Replace an element in the dom @category Manipulation @param elem The element to be replaced @param replacement The element to be added