A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/en-US/docs/Web/API/HTMLOptionsCollection/remove below:

HTMLOptionsCollection: remove() method - Web APIs

HTMLOptionsCollection: remove() method

The remove() method of the HTMLOptionsCollection interface removes the <option> element specified by the index from this collection.

Syntax Parameters
index

A zero-based integer for the index of the HTMLOptionElement in the HTMLOptionsCollection. If the index is not found the method has no effect.

Return value

None (undefined).

Examples
const optionList = document.querySelector("select").options;
const listLength = optionList.length;
optionList.remove(listLength - 1); // removes the last item
optionList.remove(0); // removes the first item
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4