컬랙션으로부터 선택사항을 제거한다.
![]() | Script | collection.remove(iIndex) |
반환값은 없다.
개체 | script | IE |
---|---|---|
areas | areas.remove(iIndex) | IE4.0(win16,win32,ce,unix,mac) |
controlRange | controlRange.remove(iIndex) | IE5(win16,win32,unix,mac |
options | options.remove(iIndex) | IE4.0(win16,win32,ce,unix,mac) |
select | select.remove(iIndex) | IE4.0(win16,win32,ce,unix,mac) |
이 메서드는 (영어)DOM Level 1(Document Object Model Level 1)에서 정의되었다.
![]() | remove 메서드⇒ | ![]() | ![]() ![]() ![]() |
<SCRIPT> function removeit(){ obj=document.testForm.testSelect; lastobj=obj.options[(obj.options.length-1)]; alert(lastobj.text+'['+lastobj.index+'] 삭제'); obj.remove(lastobj.index); obj.focus(); } </SCRIPT> <FORM name=testForm> <SELECT id=testSelect size=9> <OPTION>선택 1 <OPTION>선택 2 <OPTION>선택 3 <OPTION>선택 4 <OPTION>선택 5 <OPTION>선택 6 <OPTION>선택 7 <OPTION>선택 8 <OPTION>선택 9 </SELECT> <INPUT type=button value='선택 항목 삭제' onClick="removeit()"> </FORM>
![]() | remove 메서드 | ⇒ | ![]() ![]() |
최종 수정: 04/06/2025 03:53:19 | ![]() All right reserved | 비정상적인 방식으로 프레임없이 페이지에 접속하면 자주 오류가 발생됩니다. 오류가 나면 정상적 접속으로 시도해 보세요. | http://koxo.com/lang/js/method/remove_option.html |