开发者

Get selected value from dropdown with jQuery and title

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开发者_如何学C()

but wasn't very successfull.

Any ideas? Thanks in advance.


with your comment you can select the selected option only in

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜