easyUI and jquery selector - Stack Overflow
阿神
阿神 2017-05-19 10:31:21
0
3
585
            <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.

阿神
阿神

闭关修行中......

reply all(3)
为情所困

$("opption[value='4100001']").val();

漂亮男人

Get the text selected by select:

$(".easyui-combobox").find("option:selected").text();

我想大声告诉你

$("select[name='deviceId']").val();

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template