js中没有insertAfter元素,只有insertBefore函数:
function insertAfter(newElement, targentElement) { var parent = targentElement.parentNode; if (parent.lastChild == targentElement) { parent.appendChild(newElement); } else { parent.insertBefore(newElement, targentElement.nextSibling) } }
完!