diff --git a/dom.js b/dom.js index b13b371..fdd31d1 100644 --- a/dom.js +++ b/dom.js @@ -522,7 +522,7 @@ function _insertBefore(parentNode,newChild,nextChild){ if(pre){ pre.nextSibling = newFirst; }else{ - parentNode.firstChild = newFirst; + nextChild.parentNode.firstChild = newFirst; } if(nextChild == null){ parentNode.lastChild = newLast;