简体   繁体   中英

icCube drop-down widget - How to get Selected Item?

I want to get selected items from iccube-dropdown-widget with javascript. Drop-down-widget has Div-ID 'icCubeDropDown'.

var t = window.document.getElementById(‘icCubeDropDown’);  

doesn't work, t is Null. How can I do this?

Thanks in advance!

EDIT

var text = $("#w8 select.icCubeDropDown").children("option").filter(":selected").text(); var text is empty. What is wrong?

Here is my report code:

my report code

You're mixing class with id, 'icCubeDropDown' is a class. Id's in icCube are more like 'ic3-131'.

I'd be using jquery selectors

var select = $("#ic3-131 select.icCubeDropDown")

this finds the element with id ic3-131 and a select descendant.

hope it helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM