Okay sorry, this might be of more help?

To get away from using `inject` on each element iteration in your array and 
just using the `replaceChild` you could do as Ger recommended and add them 
all to a parent node. If you used a document fragment you wouldn't have a 
leftover wrapper element when replacing. 
http://jsfiddle.net/subhaze/AfeBV/2/

Elements.implement('replaces', function(old) {
    if (!old) return;
    var _old = document.id(old, true),
        _frag = document.createDocumentFragment(),
        i = 0,
        len;
    for (len = this.length; i < len; i++) _frag.appendChild(this[i]);
    _old.parentNode.replaceChild(_frag, _old);
    return this;
});

Reply via email to