all Ä÷º¼ÇÀ̳ª ´Ù¸¥ Ä÷º¼Çµé·ÎºÎÅÍ ÁöÁ¤µÈ °³Ã¼¸¦ ¹ÝȯÇÑ´Ù.
¹Ýȯ°ª oObjÀº ¼º°øÀûÀÌ¸é °³Ã¼µéÀÇ Ä÷º¼ÇÀ» ¹ÝȯÇÏ°í, ½ÇÆÐÇϸé nullÀ» ¹ÝȯÇÑ´Ù.
item ¸Þ¼µå´Â form·Î ºÎÅÍ input type=image ¿¤·¹¸àÆ®¸¦ ¹ÝȯÇÒ ¼ö ¾ø´Ù.
¸ðµç ¿¤·¹¸àÆ®¿¡ Á¢¼ÓÇϱâ À§ÇÏ¿© children Ä÷º¼ÇÀ» »ç¿ëÇÏ¿©¾ß ÇÑ´Ù.
°³Ã¼ | script | IE |
---|
ÀÌ ¸Þ¼µå´Â (¿µ¾î)DOM Level 1(Document Object Model Level 1)¿¡¼ Á¤ÀǵǾú´Ù.
item ¸Þ¼µå¸¦ »ç¿ëÇÏ¿© ¹®¼³»ÀÇ ¸ðµç ¿¤·¹¸àÆ®¸¦ µð½ºÇ÷¹ÀÌÇÑ´Ù.
<SCRIPT> function showAll(){ var coll=document.all; str='coll.length='+coll.length+'<BR>'; if (coll!=null){ for (i=0;i< coll.length;i++) str+=i+'] '+coll.item(i).tagName+', '; } showA.innerHTML=str; } </SCRIPT> <BUTTON onclick=showAll()>¸ðµç ű׸¦ µð½ºÇ÷¹ÀÌÇÑ´Ù.</BUTTON> <DIV id=showA style=font-size:9pt>°á°ú Ç¥½Ãâ</DIV>
item ¸Þ¼µå¸¦ »ç¿ëÇÏ¿© id°¡ ÀÏÄ¡ÇÏ´Â ¿¤·¹¸àÆ®ÀÇ Ä÷º¼ÇÀ» ã¾Æ µð½ºÇ÷¹ÀÌÇÑ´Ù.
<SCRIPT> function showTest(){ var coll=document.all.item('Test'); str='coll.length='+coll.length+'<BR>'; if (coll !=null){ for (i=0;i< coll.length;i++){ str+=i+'] coll.item('+i+').tagName='+coll.item(i).tagName+', coll.item('+i+').innerText='+coll.item(i).innerText+'<BR>'; } } showB.innerHTML=str; } </SCRIPT> <SPAN id="Test" style="border:solid 1 blue">Test1 Span</SPAN> <SPAN id="Test" style="border:solid 1 blue">Test2 Span</SPAN><BR> <BUTTON onclick="showTest()">¸ðµç Test¸¦ µð½ºÇ÷¹ÀÌÇÑ´Ù.</BUTTON> <DIV id=showB style=font-size:9pt>°á°ú Ç¥½Ãâ</DIV>
item ¸Þ¼µå¸¦ »ç¿ëÇÏ¿© id°¡ ÀÏÄ¡ÇÏ´Â ¿¤·¹¸àÆ®ÀÇ Ä÷º¼ÇÀ» ã¾Æ iSubIndex ÆĶó¸ÞÅÍ·Î °³º° Ç׸ñÀ» µð½ºÇ÷¹ÀÌÇÑ´Ù.
<SCRIPT> function showOneTest(){ var coll=document.all.item('Test') str='coll.length='+coll.length+'<BR>'; if (coll!=null) { for (i=0;i< coll.length;i++){ str+=i+'] coll.item("Test",'+i+').tagName='+coll.item('Test',i).tagName; str+=', coll.item("Test",'+i+').innerText='+coll.item('Test',i).innerText+'<BR>'; } } showC.innerHTML=str; } </SCRIPT> <BUTTON onclick="showOneTest()">¸ðµç Test¸¦ µð½ºÇ÷¹ÀÌÇÑ´Ù.</BUTTON> <DIV id=showC style=font-size:9pt>°á°ú Ç¥½Ãâ</DIV>