zoukankan      html  css  js  c++  java
  • easyui combobox name选择器

    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=" 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; 106px;">
    class="textbox-value"type="hidden"name="myinputdom"value="3 hours"><!-- 使用表单加属性选择器选中的是该元素,因为该元素不是easyui-combobox类型,所有无法使用combobox的方法 --!>
    </span>
     
    所以,我们可以使用ID和类选择器去编辑easyui组件,不可以用input[name='myinputdom']。一般来说,单个组件我们可以使用ID选择器,批量编辑我们可以使用类选择器。
     
  • 相关阅读:
    oracle中xhost报错
    cronolog切割apache和tomcat日志
    rsync配置和同步数据
    Jenkins+GitHub+maven
    Git只获取部分目录的内容
    git命令综合
    tomcat(不仅仅是tomcat)通过熵池解决在linux启动应用慢
    iptables之ipset集群工具
    Python中yield表达式的使用
    对于python中出现UnicodeDecodeError问题的解决方案
  • 原文地址:https://www.cnblogs.com/linvan/p/6949765.html
Copyright © 2011-2022 走看看