HTMLOptionsCollection - Web APIs | MDN

developer.mozilla.org

Tin mới

HTML: Markup language

See all HTML references

Date & time formats

See all HTML guides

CSS: Styling language

See all CSS references

See all CSS guides

Centering an element

JavaScript: Scripting language

Standard built-in objects

Expressions & operators

Statements & declarations

See all JavaScript references

Control flow & error handing

Loops and iteration

Working with objects

See all JavaScript guides

Web APIs: Programming interfaces

Service worker API

Using the Web animation API

Using the Fetch API

Working with the History API

Using the Web speech API

All web technology

Progressive web apps

Learn web development

Getting started modules

Structuring content with HTML module

CSS styling basics module

Dynamic scripting with JavaScript module

Border-image generator

Border-radius generator

Box-shadow generator

Color format converter

HTMLOptionsCollection.length

Returns or sets the number of options in the collection.

HTMLOptionsCollection.selectedIndex

Returns or sets the number of options in the collection.

HTMLOptionsCollection.add()

Appends an HTMLOptionElement or HTMLOptGroupElement element to the collection of option elements or adds it before a specified option.

HTMLOptGroupElement

Appends an HTMLOptionElement or HTMLOptGroupElement element to the collection of option elements or adds it before a specified option.

HTMLOptionsCollection.remove()

Appends an HTMLOptionElement or HTMLOptGroupElement element to the collection of option elements or adds it before a specified option.

Indexed collections guide

Learn how to contribute

This page was last modified on Apr 10, 2025 by MDN contributors.

HTMLDataListElement

HTMLFieldSetElement

HTMLFormControlsCollection

HTMLFrameSetElement

HTMLGeolocationElement

HTMLHeadingElement

HTMLParagraphElement

HTMLPictureElement

HTMLProgressElement