Tutorial :Get selected value from dropdown with jQuery and title



Question:

To get the selected value from a dropdown with ID is easy:

$("#ComboBox option:selected").text()  

However I can't use ID and need to get it by title/a select element, how do I do that? I tried something like: var item_level = $('select:contains("Item Level")').text()

but wasn't very successfull.

Any ideas? Thanks in advance.


Solution:1

with your comment you can select the selected option only in

$("select[title=Item Level] option:selected").text();  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »