areas, controlRange ȤÀº options Ä÷º¼Ç¿¡ »õ·Î¿î ¿¤·¹¸àÆ®¸¦ Ãß°¡ÇÑ´Ù.

Àμö/ÆĶó¸ÞÅÍ
oVal
Çʼö¿ä¼ÒÀÌ°í, Ä÷º¼Ç¿¡ Ãß°¡µÇ´Â ¿¤·¹¸àÆ®¸¦ ÁöÁ¤ÇÑ´Ù.
index
¼±ÅÃÀû ¿ä¼ÒÀÌ°í, Á¤¼ö°ª Àμö·Î Ãß°¡µÇ´Â ¿¤·¹¸àÆ®ÀÇ À§Ä¡¸¦ ÁöÁ¤ÇÑ´Ù.
Àμö°ªÀÌ ÁöÁ¤µÇÁö ¾ÊÀ¸¸é Ä÷º¼ÇÀÇ Á¦ÀÏ µÚ¿¡ Ãß°¡µÈ´Ù.
¹Ýȯ°ª

¹Ýȯ°ªÀº ¾ø´Ù.

Ư±â

¿¤·¹¸àÆ®¸¦ Ä÷º¼Ç¿¡ Ãß°¡Çϱâ À§Çؼ­´Â ¸ÕÀú createElement ¸Þ¼­µå·Î °³Ã¼¸¦ »ý¼ºÇÏ¿©¾ß ÇÑ´Ù.

ÀÌ ¸Þ¼­µå¿¡ ÀÇÇÑ ¿¤·¹¸àÆ®ÀÇ Ãß°¡´Â ¹®¼­ÀÇ ·ÎµùÀÌ ¿Ï·áµÇ¾úÀ» ¶§¸¸ °¡´ÉÇÏ´Ù.

ÀÌ ¸Þ¼­µå°¡ ÀζóÀο¡ Àû¿ëµÇ¸é ·±Å¸ÀÓ ¿À·ù°¡ ¹ß»ýµÈ´Ù.

Àû¿ë
°³Ã¼scriptIE
ÂüÁ¶
remove

ÀÌ ¸Þ¼­µå´Â (¿µ¾î)DOM Level 1(Document Object Model Level 1)¿¡¼­ Á¤ÀǵǾú´Ù.


select °³Ã¼¿¡ »õ·Î¿î Option ¼±ÅûçÇ×À» Ãß°¡ÇÑ´Ù.

<SCRIPT>
function addit(){
  var obj=document.myForm.selObj;
  var addedOpt=document.createElement('OPTION');
  obj.add(addedOpt);
  addedOpt.innerText='Ãß°¡µÈ Ç׸ñ'+obj.length;
  addedOpt.value='Ãß°¡µÈ Ç׸ñ'+obj.length;
  addedOpt.selected=true;
  obj.focus();
  alert('['+obj[(obj.length-1)].text+'] Ãß°¡ ¿Ï·á');
}
</SCRIPT>

<FORM name="myForm" action="http://koxo.com/lang/js/object/exp/xsubmit.cgi">
<SELECT name="selObj">
<OPTION value="¼±Åà Ç׸ñ 1">´çÃÊ ¼±Åà Ç׸ñ</OPTION>
</SELECT>
<BUTTON onClick="addit()">¼±Åà Ç׸ñ Ãß°¡</BUTTON>
<INPUT type=submit value="¼Û½Å">
</FORM>
<SCRIPT>
var newOption=document.createElement('OPTION');
myForm.selObj.options.add(newOption);
newOption.innerText='ÀÚµ¿ Ãß°¡ ¼±Åà Ç׸ñ';
newOption.value='¼±Åà Ç׸ñ 2';
</SCRIPT>