Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
270 views
in Technique[技术] by (71.8m points)

easyUI和jquery选择器

            <div class="fitem">
                <label class="formalg">设备名称:</label>
                <select class="easyui-combobox" name='deviceId' style="width:100px;">
                    <option value="4100001">入口</option>
                </select>
            </div>

就这么一个div,我要得到slect选择项的text,也就是入口。
$(":selected").text()$("select").find("option:selected").text();都不行,因为还有多个选择框,$("select[name='deviceId']").find("option:selected").text();返回空字符串。
EasyUI改了dom树,看来只能加个id了。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...