3 Answers3

13

Either of these will work:

find by :selected pseudo selector in descendants

this.getElement(':selected');

get first selected value

this.getSelected()[0];

pure javascript, use the selectedIndex property

this.options[this.selectedIndex];
Anurag
  • 140,337
  • 36
  • 221
  • 257
4

Just access the selectedIndex property on the select element (this object in the event handler) to get the option index.

// get the index of the selected option
var index = this.selectedIndex;

// get the option element
var opt   = this.options[index];
Andy E
  • 338,112
  • 86
  • 474
  • 445
0

event.target.id is the object

event.target.value is the new value

Chris Walsh
  • 3,423
  • 2
  • 42
  • 62