Select length Property
Example
Return the number of <option> elements found in a drop-down list:
var x = document.getElementById("mySelect").length;
Try it Yourself »
Description
The length property returns the number of <option> elements in a drop-down list.
Browser Support
Property | |||||
---|---|---|---|---|---|
length | Yes | Yes | Yes | Yes | Yes |
Syntax
selectObject.length
Technical Details
Return Value: | A Number, representing the number of <option> elements found in the drop-down list |
---|
❮ Select Object
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.