°³Ã¼ÀÇ À̸§À» ¹ÝȯÇϰųª ¼³Á¤ÇÑ´Ù.
ÀÌ ¼Ó¼ºÀº Àбâ/¾²±âÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.
formÀ» ¼Û½ÅÇÒ ¶§ name ¼Ó¼ºÀ» Á¦¾î°ª¿¡ °áÇÕÇϴµ¥ »ç¿ëÇÑ´Ù.
nameÀº input type=button, input type=reset, input type=submit ÀÔ·Â Çü½Ä¿¡¼ µð½ºÇ÷¹À̵Ǵ °ªÀÌ ¾Æ´Ï°í formÀÌ ¼Û½ÅµÉ ¶§ º¸³»Áö´Â °ªÀÌ´Ù.
JScript¿¡¼ ·±Å¸ÀÓ¿¡ name ¼Ó¼º°ªÀ» º¯°æ½Ãų ¼ö ÀÖ´Ù. ±×·¯³ª ¿¤·¹¸àÆ®µéÀÇ Ä÷º¼Ç¿¡ ÇÁ·Î±×·¥À¸·Î º¯°æÀ» ÁÖÁö ¾Ê°í formÀÌ ¼Û½ÅµÉ ¶§¸¸ À̸§ÀÌ ¹Ù²ï´Ù.
createElement ¸Þ¼µå¸¦ ÀÌ¿ëÇÏ¿© ź·ÂÀûÀ¸·Î »ý¼ºµÈ ¿¤·¹¸ÇÆ®¿¡¼´Â name ¼Ó¼º°ªÀ» ·±Å¸ÀÓ¿¡ º¯°æ½Ãų ¼ö ¾ø´Ù. createElement ¸Þ¼µå¸¦ ÀÌ¿ëÇÏ¿© ¿¤·¹¸àÆ®¸¦ »ý¼ºÇÒ ¶§ name ¼Ó¼ºÀ» °ª°ú ÇÔ²² ¼³Á¤ÇÑ´Ù.
À̼ӼºÀº IE6ºÎÅÍ attribute °³Ã¼¿¡µµ Àû¿ëµÈ´Ù.
°³Ã¼ | script | HTML | ±Ô°Ý | IE |
---|
ÀÌ ¼Ó¼ºÀº (¿µ¹®) HTML 3.2¿Í (¿µ¹®) W3C DOM Level 1(Document Object Model)¿¡¼ Á¤ÀǵǾú´Ù.
<SCRIPT> var aObj=document.createElement('A'); aObj.href='http://trio.co.kr/webrefer/html/cover.html'; aObj.name='htmlStd'; aObj.target='_newWin'; aObj.innerText='HTML ±Ô°ÝÀ¸·Î'; str='aObj.nodeName=<FONT color=blue>'+aObj.nodeName+'</FONT><BR>'; str+='aObj.name=<FONT color=blue>'+aObj.name+'</FONT><BR>'; str+='aObj.target=<FONT color=blue>'+aObj.target+'</FONT><BR>'; str+='aObj.href=<FONT color=blue>'+aObj.href+'</FONT><BR>'; str+='aObj.innerText=<FONT color=blue>'+aObj.innerText+'</FONT><BR>'; str+='aObj=<FONT color=blue>'+aObj+'</FONT><BR>'; str+='aObj.outerHTML=<FONT color=blue>'+aObj.outerHTML+'</FONT><BR>'; document.write(str); </SCRIPT>
<DIV class=show> <FORM name=testForm><IMG src=../../gif/rfexample.gif name=testImage> <INPUT type=text value="testText" name="testText"> <INPUT type=button value="testInput" name="testInput"> </FORM> </DIV> <SCRIPT> var br='<BR>'; document.write('top.frames[0].name='+top.frames[0].name+br); document.write('top.frames[1].name='+top.frames[1].name+br); document.write('top.frames[1].frames[0].name='+top.frames[1].frames[0].name+br); document.write('top.frames[1].frames[1].name='+top.frames[1].frames[1].name+br); document.write('this.name='+this.name+br+br); top.window.name='Javascript'; document.write('top.window.name='+top.window.name+br); document.write('document.images[document.images.length-1].name=', document.forms[document.images.length-1].name+br+br); document.write('document.forms[document.forms.length-1].name=', document.forms[document.forms.length-1].name+br); document.write('document.forms[document.forms.length-1].elements[0].name=', document.forms[document.forms.length-1].elements[0].name+br); document.write('document.forms[document.forms.length-1].elements[1].name=', document.forms[document.forms.length-1].elements[1].name+br); </SCRIPT> <SCRIPT>