web api instance property
HTMLSelectElement: length property
The length property of the HTMLSelectElement interface specifies the number of <option> elements in the <select> element. It represents the number of nodes in the options collection. On setting, it acts as (length).
Value
A number.
Examples
const selectElement = document.getElementById("fruits");
console.log(selectElement.length);
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.