<p class="fitem">
<label class="formalg">设备名称:</label>
<select class="easyui-combobox" name='deviceId' style="width:100px;">
<option value="4100001">入口</option>
</select>
</p>
Just such a p, I want to get the text of the select option, which is the entrance. $(":selected").text()
and $("select").find("option:selected").text();
will not work, Because there are multiple selection boxes, $("select[name='deviceId']").find("option:selected").text();
returns an empty string.
EasyUI has changed the dom tree, it seems that it can only add an id.
漂亮男人2017-05-19 10:33:21
Get the text selected by select:
$(".easyui-combobox").find("option:selected").text();