I have some markup:
<select name="serviceID[1]" id="serviceID[1]" class="computeThisService">
<option value="" selected="selected">No Selection</option>
<option value="4">TJ5</option>
<option value="1">TJ2</option>
<option value="5">TJ1</option>
<option value="2">TJ3</option>
</select>
I am trying to get the selected value and this does not work:
var triggerID = event.target.id; // get the id that triggered the event
var nStart = triggerID.indexOf('[') + 1;
var nEnd = triggerID.indexOf(']');
j = triggerID.substring(nStart, nEnd); // get the index of the id that triggered the event
var el = $('select option:selected', this);
alert(el.text());