text1 text2
You can get the index of the element in this case by checking how many sibling elements the selected element has before it:
$('#sel option:selected').prevAll().length;