--- title: HTMLSelectElement.remove() slug: Web/API/HTMLSelectElement/remove translation_of: Web/API/HTMLSelectElement/remove ---
{{ APIRef("HTML DOM") }}
La méthode HTMLSelectElement.remove()
enlève l'option à l'index choisi dans la liste des options de cet objet select.
collection.remove(index);
var sel = document.getElementById("maListe"); sel.remove(1); /* Prend l'objet select existant suivant : <select id="maListe" name="maListe"> <option value="1">Option: Value 1</option> <option value="2">Option: Value 2</option> <option value="3">Option: Value 3</option> </select> Et le transforme en: <select id="maListe" name="maListe"> <option value="1">Option: Value 1</option> <option value="3">Option: Value 3</option> </select> */
Spécification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', '#dom-select-remove', 'HTMLSelectElement.remove()')}} | {{Spec2('HTML WHATWG')}} | |
{{SpecName('HTML5 W3C', 'forms.html#dom-select-remove', 'HTMLSelectElement.remove()')}} | {{Spec2('HTML5 W3C')}} | Is a snapshot of {{SpecName("HTML WHATWG")}}. |
{{SpecName('DOM2 HTML', 'html.html#ID-33404570', 'HTMLSelectElement.remove()')}} | {{Spec2('DOM2 HTML')}} | |
{{SpecName('DOM1', 'level-one-html.html#ID-33404570', 'HTMLSelectElement.remove()')}} | {{Spec2('DOM1')}} | Initial definition. |
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatUnknown}} |