Get selected value in dropdown list using JavaScript

The drop-down list selectedIndex property in HTML DOM is sets or returns the index of the selected option in a drop-down list.

  1. Get from selectedIndex property.

  1. Set the Select selectedIndex property.

The index starts at 0 and if no element is selected then it return -1. If the drop-down list allows multiple selections it will only return the index of the first option selected.

run this source code Try it Yourself

Full Source | JavaScript

Javascript drop down selected item

 (C) 2022    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.
SiteMap  | Terms  | About