某元素如果是其父元素的最后一个元素用appendChild
某元素如果不是其父元素的最后一个元素,先取其nextSibling , 再用insertBefore
var node = node.nextSibling;

解决方案 »

  1.   

    试试这个.. insertAdjacentHTMLinsertAdjacentHTML Method  Internet Development Index --------------------------------------------------------------------------------Inserts the given HTML text into the element at the location.Syntaxobject.insertAdjacentHTML(sWhere, sText)
    ParameterssWhere Required. String that specifies where to insert the HTML text, using one of the following values: beforeBegin Inserts sText immediately before the object. 
    afterBegin Inserts sText after the start of the object but before all other content in the object. 
    beforeEnd Inserts sText immediately before the end of the object but after all other content in the object. 
    afterEnd Inserts sText immediately after the end of the object. 
     
    sText Required. String that specifies the HTML text to insert. The string can be a combination of text and HTML tags. This must be well-formed, valid HTML or this method will fail. 
      

  2.   

    我比较喜欢那些习惯看标准文档的人!!www.w3.org!!!!!!!!