在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ EasyUI HTML頁面的 <select> 標(biāo)簽用作 combo

EasyUI HTML頁面的 <select> 標(biāo)簽用作 combobox,怎樣獲取到選中項的值?

<!--貼上html代碼--> 
<select id="ddlState" name="ddlState" class="easyui-combobox" data-options="panelHeight:45,editable:false" style="width: 80px;">
    <option value="0">正常</option>
    <option value="1">下架</option>
</select>

//在網(wǎng)上找到了一種方法,但有問題
    function a() {
        var itemState = document.getElementById("ddlState");
        var index = itemState.selectedIndex;
        State = itemState.options[index].value;
        alert("state:" + State);
        alert("index:" + index)
    }
回答
編輯回答
真難過
$("#ddlState").combobox('getValue');//獲取value值
$("#ddlState").combobox('getText');//獲取text值

你試試這兩個,我用的input元素創(chuàng)建的combobox,是可以的

2018年7月29日 04:15