¹®¼ °èÅëµµ¿¡¼ ¸ðü °³Ã¼¸¦ ¹ÝȯÇÑ´Ù.
ÀÌ ¼Ó¼ºÀº ÀбâÀü¿ëÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.
ÃÖ»óÀ§ °³Ã¼¿¡¼´Â ¸ðü °³Ã¼ nullÀ» ¹ÝȯÇÑ´Ù.
°³Ã¼ | script | HTML | ±Ô°Ý | IE |
---|
À̼ӼºÀº IE6ºÎÅÍ attribute °³Ã¼¿¡µµ Àû¿ëµÈ´Ù.
ÀÌ ¼Ó¼ºÀº (¿µ¹®) W3C DOM Level 1(Document Object Model)¿¡¼ Á¤ÀǵǾú´Ù.
<STYLE>xmp{margin:0;padding:0;color:teal}</STYLE> <DIV id=divBox style="border:solid 1 blue"><SPAN id=spanObj>SPAN id=spanObj</SPAN></DIV> <SCRIPT> document.write('<XMP>'+divBox.innerHTML+'</XMP>'); document.write('spanObj.parentNode.nodeName='+spanObj.parentNode.nodeName+'<BR>'); var newBObj=document.createElement('B'); spanObj.insertBefore(newBObj); newBObj.innerText=' »õ·Î »ý¼ºµÈ ¿¤·¹¸àÆ®'; document.write('newBObj.nodeName='+newBObj.nodeName+'<BR>'); document.write('newBObj.parentNode.nodeName='+newBObj.parentNode.nodeName); document.write('<XMP>'+divBox.innerHTML+'</XMP>'); </SCRIPT>
<SCRIPT> str='document.body.parentElement.nodeName='+document.body.parentNode.nodeName+'<BR>'; str+='document.all.tags("tBody")(0).parentNode.nodeName='+document.all.tags("tBody")(0).parentNode.nodeName+'<BR>'; str+='document.all.tags("tr")(0).parentNode.nodeName='+document.all.tags("tr")(0).parentNode.nodeName+'<BR>'; str+='document.all.tags("td")[0].parentNode.nodeName='+document.all.tags("td")[0].parentNode.nodeName+'<BR>'; document.write(str); </SCRIPT>