°³Ã¼¸¦ ´Ù¸¥ ¿¤·¹¸àÆ®·Î ±³Ã¼ÇÑ´Ù.

Àμö/ÆĶó¸ÞÅÍ
oNewNode
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, °³Ã¼¸¦ ±³Ã¼ÇÒ »õ·Î¿î °³Ã¼ÀÌ´Ù.
¹Ýȯ°ª

¹Ýȯ°ª oVal´Â ±³Ã¼µÈ °³Ã¼¸¦ ÂüÁ¶ÇÑ´Ù.

Ư±â

³ëµå°¡ ±³Ã¼µÉ ¶§, ±³Ã¼µÇ´Â °³Ã¼¿Í ¿¬°üµÈ ¸ðµç °ªµéÀº Á¦°ÅµÈ´Ù. ¿¹¸¦µé¾î b °³Ã¼°¡ i °³Ã¼·Î ´ëüµÇ¸é ±× ½ÃÀÛű׿¡¼­ Á¾·áÅÂ±× »çÀÌÀÇ ¸ðµç ¹®ÀÚ¿­°ú ¾ÖÆ®¸®ºäÆ®µéÀº ¸ðµÎ ±³Ã¼µÈ´Ù. ÀÌµé °ªµéÀ» º¸Á¸Çϱâ À§ÇÏ¿© ¿ø·¡ÀÇ °³Ã¼°¡ ±³Ã¼µÇ±â Àü¿¡ »õ·Î¿î ¿¤·¹¸àÆ®¿¡ º¹»çÇÒ ¼ö ÀÖ´Ù.

ÀÌ ¸Þ¼­µå´Â ·±Å¸ÀÓ(run time)¿¡ Á¢¼ÓÇÒ ¼ö ÀÖ´Ù. ·±Å¸ÀÓ¿¡¼­ ÀÌ ¿¤·¹¸àÆ®°¡ Á¾·áűװ¡ ÆĽ̵DZâ Àü¿¡ Á¦°ÅµÇ¸é, ¹®¼­ÀÇ Áö¿ªµéÀº Ç¥ÇöµÇÁö ¾ÊÀ» ¼ö ÀÖ´Ù.

Àû¿ë
A ACRONYM ADDRESS B BDO BIG BLOCKQUOTE BODY BUTTON CAPTION CENTER CITE CODE COL COLGROUP COMMENT DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAMESET HEAD hn HTML I IFRAME INPUT type=button INPUT type=checkbox INPUT type=file INPUT type=image INPUT type=password INPUT type=radio INPUT type=reset INPUT type=submit INPUT type=text INS KBD LABEL LEGEND LI LISTING MAP MARQUEE MENU nextID OBJECT OL OPTION P PLAINTEXT PRE Q S SAMP SELECT SMALL SPAN STRIKE STRONG SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TR TT U UL VAR XMP
ÂüÁ¶
replaceChild, (¿µ¹®)DOM(W3C Document Object Model)

replaceNode ¸Þ¼­µå·Î ul °³Ã¼¸¦ ol °³Ã¼·Î ´ëüÇÏ°í ³»¿ëÀº º¹»çÇÏ¿´´Ù.

<UL id=oList>
<LI>¸ñ·Ï Ç׸ñ 1
<LI>¸ñ·Ï Ç׸ñ 2
<LI>¸ñ·Ï Ç׸ñ 3
<LI>¸ñ·Ï Ç׸ñ 4
</UL>
<BUTTON id=butObj onclick="fnReplace()">¸ñ·Ï ±³Ã¼</BUTTON>
<SCRIPT>
function fnReplace(){
  var sPreserve = oList.innerHTML;
  var oNewNode = document.createElement('OL');
  showB.innerHTML=oList.nodeName+' ¢º ';
  oList.replaceNode(oNewNode);
  oNewNode.innerHTML = showA.innerText = sPreserve;
  showB.innerHTML+=oNewNode.nodeName;
  butObj.disabled=true;
}
</SCRIPT>
<DIV id=showA></DIV>
<DIV id=showB></DIV>