dropdown - get index of item with specific attribut

dropdown - get index of item with specific attribut

hi
  1. <select id="myselect">
  2.       <option value="a">test</option>
  3.       <option value="b">test</option>
  4.       <option value="c">test</option>
  5. </select>
i need to somehow get the index of the item with value "c" (so it will return 2). how to do so? thanks