+ 11
How to get selected text from select tag using jquery?
5 Respostas
+ 8
It is ok but without passing value we can also get selected text.
var value = $("#yourdropdownid option:selected").text();
+ 5
you can get the value of selected text by using this single line of code
$("#select option:selected").text();
+ 4
Just like any other value
var value = $(”#select”).val();
$(”#select option[value=’” + value + ”’]”).text()
<select id=”select”>
<option value=”selected”>Value</option>
</select>
Make sure options have value attr
+ 4
It will get value not text. I want text not value...
+ 1
Check my edit