Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. HTMLOptionsCollection

HTMLOptionsCollection

TheHTMLOptionsCollection interface represents a collection of<option> HTML elements (in document order) and offers methods and properties for selecting from the list as well as optionally altering its items. This object is returned only by theoptions property ofselect.

HTMLCollection HTMLOptionsCollection

Instance properties

HTMLOptionsCollection.length

Returns or sets the number of options in the collection.

HTMLOptionsCollection.selectedIndex

The index number of the first selected<option> element. The value-1 indicates no element is selected.

Instance methods

This interface inherits the methods of its parent,HTMLCollection.

HTMLOptionsCollection.add()

Appends anHTMLOptionElement orHTMLOptGroupElement element to the collection ofoption elements or adds it before a specified option.

HTMLOptionsCollection.remove()

Removes the element at the specified index from the options collection.

Specifications

Specification
HTML
# the-htmloptionscollection-interface

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp