formÀÇ select °³Ã¼¿¡¼ º¹¼ö ¼±ÅÃÀÌ °¡´ÉÇÑ°¡¸¦ ºÎ¿ï°ªÀ¸·Î ¹ÝȯÇϰųª ¼³Á¤ÇÑ´Ù.
false | µðÆúÆ®À̸ç, º¹¼ö ¼±ÅÃÀÌ ºÒ°¡´ÉÇÏ´Ù. |
true | º¹¼ö ¼±ÅÃÀÌ °¡´ÉÇÏ´Ù. |
ÀÌ ¼Ó¼ºÀº Àбâ/¾²±â·Î µðÆúÆ®°ªÀº falseÀÌ´Ù.
°³Ã¼ | script | HTML | ±Ô°Ý | IE |
---|
ÀÌ ¼Ó¼ºÀº (¿µ¹®) HTML 3.2¿Í (¿µ¹®) W3C DOM Level 1(Document Object Model)¿¡¼ Á¤ÀǵǾú´Ù.
<SCRIPT> function showSelected(){ str=''; for (i=0;i< selObj.length;i++){ str+='selObj.options['+i+'].selected='+selObj.options[i].selected+'<BR>'; } showB.innerHTML=str; } </SCRIPT> <SELECT id=selObj onchange="showSelected()"> <OPTION>Ç׸ñ ¼±Åà 1</OPTION> <OPTION>Ç׸ñ ¼±Åà 2</OPTION> <OPTION selected>Ç׸ñ ¼±Åà 3</OPTION> <OPTION>Ç׸ñ ¼±Åà 4</OPTION> <OPTION>Ç׸ñ ¼±Åà 5</OPTION> </SELECT></DIV> <BUTTON onclick="selObj.multiple=false;showA.innerText='selObj.multiple='+selObj.multiple">´ÜÀÏ ¼±ÅÃ</BUTTON> <BUTTON onclick="selObj.multiple=true;showA.innerText='selObj.multiple='+selObj.multiple">º¹¼ö ¼±ÅÃ</BUTTON> <DIV id=showA>°á°ú Ç¥½Ãâ</DIV> <DIV id=showB>°á°ú Ç¥½Ãâ</DIV>