tags:

views:

44

answers:

1

Hi,

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.

A: 

with your comment you can select the selected option only in

$("select[title=Item Level] option:selected").text();
rob waminal
Hi Rob, that gives me a pop up with nothing in itvar item_level = $("select[title='Item Level']option:selected").text();alert(item_level);It is only 4 options and the dropdownlist works as a hidden filter
Morgan
copy exactly what I placed in the snippet. don't put `'` in `Item Level` and put space between ] and `option`
rob waminal
thanks Rob, it helped!
Morgan