how to use selected index by name code example
Example: get index of selected option javascript
$("#sel").attr("selectedIndex")
// or
$("#sel")[0].selectedIndex
//or
$(this).prop('selectedIndex')
$("#sel").attr("selectedIndex")
// or
$("#sel")[0].selectedIndex
//or
$(this).prop('selectedIndex')