For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

Interface HTMLOptionsCollection

The HTMLOptionsCollection interface represents a collection of

MDN Reference

interface HTMLOptionsCollection {
    length: number;
    selectedIndex: number;
    "[iterator]"(): ArrayIterator<HTMLOptionElement>;
    add(
        element: HTMLOptGroupElement | HTMLOptionElement,
        before?: number | HTMLElement | null,
    ): void;
    item(index: number): HTMLOptionElement | null;
    namedItem(name: string): HTMLOptionElement | null;
    remove(index: number): void;
    [index: number]: HTMLOptionElement;
}

Hierarchy (View Summary)

Indexable

Index
length: number

The length property of the HTMLOptionsCollection interface returns the number of

MDN Reference

selectedIndex: number

The selectedIndex property of the HTMLOptionsCollection interface is the numeric index of the first selected

MDN Reference

  • The remove() method of the HTMLOptionsCollection interface removes the

    MDN Reference

    Parameters

    • index: number

    Returns void

Was this helpful?