HTMLOptionsCollection
Types
t
HTMLOptionsCollection is an interface representing a collection of HTML option elements (in document order) and offers methods and properties for traversing the list as well as optionally altering its items. This type is returned solely by the "options" property of select. See HTMLOptionsCollection on MDN TODO: mark as private once mutating fields of private records is allowed
type t = {length: int, mutable selectedIndex: int}Record fields
selectedIndex
Returns the index of the first selected item, if any, or -1 if there is no selected item.
Can be set, to change the selection. Read more on MDN
Values
add
Inserts element before the DOMTree.node given by before.
The before argument can be a number, in which case element is inserted before the item with that number, or an element from the collection, in which case element is inserted before that element.
If before is omitted, null, or a number out of range, then element will be added at the end of the list.
This method will throw a "HierarchyRequestError" DOMException if element is an ancestor of the element into which it is to be inserted. Read more on MDN
let add: (t, ~element: unknown, ~before: unknown=?) => unitremove
Removes the item with index index from the collection. Read more on MDN
let remove: (t, int) => unit