您的位置:首页 > 产品设计 > UI/UE

easyui-combobox如何使用选择器

2015-08-25 16:03 411 查看
HTML:

<input name="myinputdom" id="myinputdom" class="easyui-combobox
myinputdom" data-options="......" />

当使用如下选择器来操作combobox对象时,会出现不同的表现。

Javascript:

$('input[name=myinputdom]').combobox(...);//错误

$(':input[name=myinputdom]').combobox(...);//错误
$('#myinputdom').combobox(...);//正确

$('.myinputdom').combobox(...);//正确

分析:

使用firefox查看最终的页面代码如下:

<input id="myinputdom" class="easyui-combobox
combobox-f combo-f textbox-f" data-options="......" style="display:
none;" textboxname="myinputdom" comboname="myinputdom"><!-- 使用id和class选择器选中的是该元素,因为该元素属于easyui-combobox类型,所有可以使用combobox的方法 --!>

<span class="textbox combo" style="width:
132px; height: 20px;">

<span class="textbox-addon textbox-addon-right" style="right:
0px;">

<input class="textbox-text validatebox-text" type="text" autocomplete="off" readonly="readonly" placeholder="" style="margin-left:
0px; margin-right: 18px; padding-top: 2px; padding-bottom: 2px; width: 106px;">

<input class="textbox-value" type="hidden" name="myinputdom" value="3
hours"><!--
使用表单加属性选择器选中的是该元素,因为该元素不是easyui-combobox类型,所有无法使用combobox的方法 --!>

</span>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: