The HTML select tag is a dropdown. The elements of a select are defined by the option tag. The option tag also has the ability to contain values, which may be used to store useful information such as an index.
However, what if you don’t need the index, but rather the text being displayed of the option element? It’s not exactly intuitive… but here is one way:
The selectedOptions property on the select element will give you the list of elements that are selected (note, if you set multiple on your select, you can choose more than one option. In this case, obviously, referencing the first selected item [0] may not do exactly what you want).