To take the active index HTML option:
JavaScript
var index = $("#myColors").prop('selectedIndex');
To take the value of active HTML option:
JavaScript
var value = $("#myColors").val();
Html
<html>
<!-- heading -->
<head>
<meta charset="utf-8">
<title>Example</title>
</head>
<!-- page -->
<body>
<!-- connect the library jQuery -->
<script src="https://dir.by/example_lib/jquery/jquery-3.3.1.min.js"></script>
<!-- HTML Elements -->
<select id='myColors'>
<option value='10'>Red</optoin>
<option value='20'>Green</option>
<option value='30'>Blue</option>
</select>
<input type='button' value='Show value, index' onclick='showValue()'>
<!-- JavaScript -->
<script>
function showValue()
{
var elemSelect = $("#myColors");
// active value HTML option
var value = elemSelect.val();
// active index HTML option
var index = elemSelect.prop('selectedIndex');
// Showing on the screen
alert("meaning=" + value + " , index=" + index);
}
</script>
</body>
</html>