target.parentNode.insertBefore(new_elem, target.nextSibling); target.parentNode.insertBefore(new_elem, target.previousSibling);