Definition and Usage. I have a select element on my HTML page. If no index is specified, the new option will be inserted at the end of the list The selectedIndex property sets or returns the index of the selected value in a drop-down list. In JavaScript, selectedIndex property is used to set the value of a select box element. Must be an option or optgroup element: index: Optional. The index starts at 0. Q&A for Work. Note: The value "-1" will deselect all options (if any). Property Description; length: Returns the number of