So i have a <select> with option, but what i want when i select a option to get the option number.
I do not want him to grab attributes(No value & text). Because it is dynamic.
Example:
<select id="mySelect">
<option>Apple</option>
<option>Pear</option>
<option>Banana</option>
<option>Orange</option>
</select>
When i select Apple, that I get a response 1. so with Pear: 2. and so on.
I have found: W3school, But this will show how many option are available.
What someone here a solution for?
selectedIndexproperty contains the option number.$('option:selected').index()