Edit This Code:
See Result »
Select your favorite fruit:
Apple
Orange
Pineapple
Banana
Click the button to display the text and index of all options in the dropdown list.
Try it
Result: