JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
Select a fruit and click the button:
<select id="mySelect">
<option value="11">Apple</option>
<option value="12">Orange</option>
<option value="13">Pineapple</option>
<option value="14">Banana</option>
</select>
<button type="button" id="btn">Display index</button>
JavaScript
$('#btn').on('click',function(){
// var x = document.getElementById("mySelect").selectedIndex;
// var y = document.getElementById("mySelect").options;
var x = $("#mySelect").val();
var y = $("#mySelect option:selected").text();
alert(x+" :: "+y);
//alert("Index: " + y[x].index + " text is " + y[x].text + " and value is " + y[x].value);
});