¹®¼­ÀÇ ÃÖ»óÀ§ ³ëµå(root) ÂüÁ¶¸¦ ¹ÝȯÇÑ´Ù.

Àμö
: (¼Ó¼º °³Ã¼)
¼Ó¼º°ªÀº ¹®¼­ÀÇ ÃÖ»óÀ§³ëµå(root) ÂüÁ¶¸¦ ³ªÅ¸³»´Â °³Ã¼ÀÌ´Ù.

ÀÌ ¼Ó¼ºÀº ÀбâÀü¿ëÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.

Ư±â

°¡Àå ÀüÇüÀûÀÎ ÃÖ»óÀ§ ³ë´À´Â html °³Ã¼ÀÌ´Ù.

Àû¿ë
°³Ã¼scriptHTML±Ô°ÝIE
Âü°í

ÀÌ ¼Ó¼ºÀº (¿µ¹®) W3C DOM Level 1(Document Object Model)¿¡¼­ Á¤ÀǵǾú´Ù.


innerHTML ¼Ó¼ºÀ¸·Î ¹®¼­ ÀÚüÀÇ HTMLÀ» ¹ÝȯÇϳª TEXTAREA¿¡ Ç¥½ÃÇϹǷΠűװ¡ ¼öÇàµÇÁö´Â ¾Ê´Â´Ù.

<SCRIPT>
function getSource(){
   formObj.showA.value=document.documentElement.innerHTML;
}
</SCRIPT>
<BUTTON onclick="getSource()">¹®¼­ÀÇ ¼Ò½º º¸±â</BUTTON>
<FORM id=formObj><TEXTAREA id=showA cols=90 rows=10></TEXTAREA></FORM>