½ºÆ®¸³Æ®·Î ¾²¿©Áø À̺¥Æ®¸¦ ¹ÝȯÇϰųª ¼³Á¤ÇÑ´Ù.
ÀÌ ¼Ó¼ºÀº Àбâ/¾²±âÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.
°³Ã¼ | script | HTML | ±Ô°Ý | IE |
---|
(¿µ¹®) W3C DOM Level 2(Document Object Model).
¿¹Á¦´Â event ¼Ó¼ºÀ» ó¸®ÇÏ¿© onclick À̺¥Æ®¸¦ »ý¼ºÇÑ´Ù.
´ÜÃß¿¡ ¸¶¿ì½º¸¦ ¿Ã¸®¸é ¸¶¿ì½º¿¡¼ À̺¥Æ®°¡ ¹ß»ýµÇ¾î ½ºÅ©¸³Æ® À̺¥Æ® onclick()À» ¹ß»ý½ÃŲ´Ù.
´ÜÃ߸¦ Ŭ¸¯Çϰųª ¸¶¿ì½º¸¦ ¹ÛÀ¸·Î À̵¿Çصµ ½ºÅ©¸³Æ® À̺¥Æ® onclick()À» ¹ß»ý½ÃŲ´Ù.
<SCRIPT id="scriptObj" for="butObj" event="onclick()"> msg1="´ÜÃß Ç¥½ÃÆÇ ±³Â÷ 1" msg2="´ÜÃß Ç¥½ÃÆÇ ±³Â÷ 2" if (butObj.innerText==msg1)butObj.innerText =msg2; else if (butObj.innerText==msg2) butObj.innerText=msg1; showA.innerHTML='scriptObj.event='+scriptObj.event; </SCRIPT> <BUTTON id="butObj" onmouseover="showA.innerHTML='scriptObj.event='+scriptObj.event;showB.innerHTML='event.type='+event.type" onmouseout="showA.innerHTML='';showB.innerHTML='event.type='+event.type">´ÜÃß Ç¥½ÃÆÇ ±³Â÷ 1</BUTTON><BR> <SCRIPT> document.write('scriptObj.event='+scriptObj.event); </SCRIPT> <DIV id=showA style="border:solid 1 blue;padding:3;width:200">°á°ú Ç¥½Ãâ</DIV> <DIV id=showB style="border:solid 1 blue;padding:3;width:200">°á°ú Ç¥½Ãâ</DIV>