<div class="codetitle"> <span><a style="CURSOR: pointer" data="8155" class="copybut" id="copybut8155" onclick="doCopy('code8155')"><u>코드 복사</u></a></span> 코드는 다음과 같습니다.</div> <div class="codebody" id="code8155"> <br>//기존 요소 뒤에 새 요소 추가<br>function insertAfter(newElement, targetElement){ <br>var parent = targetElement.parentNode; <br>if (parent.lastChild == targetElement){ <br>parent.appendChild(newElement) <br>} else { <br>parent .insertBefore(newElement,targetElement.nextSibling) <br>} <br>} <br> </div>