I have a select menu. I wish to obtain the index of the currently selected option. Upon initial page load, it would be zero unless `selected="selected"` is included in the HTML. If later it was changed, the index would indicate the currently selected option. The following works on my current browser, but I would like confirmation whether this is the best cross-browser solution.

```
var i=$('#mySelectID').prop("selectedIndex");

```

Note. While I show `$('#mySelectID')`, my example actually loops over several elements so it is really `$(this)`, but I don't think that makes any difference.