jQuery get specific option tag text
If you'd like to get the option with a value of 2, use
$("#list option[value='2']").text();
If you'd like to get whichever option is currently selected, use
$("#list option:selected").text();
It's looking for an element with id list
which has a property value
equal to 2
.
What you want is the option
child of the list
:
$("#list option[value='2']").text()