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/length below:

HTMLOptionsCollection: length property - Web APIs

HTMLOptionsCollection: length property

The length property of the HTMLOptionsCollection interface returns the number of <option> elements in the collection. The property can get or set the size of the collection.

When setting length to a value smaller than the current, the options collection gets truncated; otherwise, new blank <option> elements are appended to the end of the <select>.

Value

An integer value representing the number of items in this HTMLOptionsCollection.

Example
const optCollection = document.getElementById("fruits").options;
const origLength = optCollection.length;
optCollection.length += 50; // adds 50 blank options to the collection
optCollection.length = origLength; // truncates the list back to the original size
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