【问题标题】:dropdown refresh with jquery on phonegap. "not jquery mobile"在 phonegap 上使用 jquery 刷新下拉菜单。 “不是 jquery 手机”
【发布时间】:2012-07-18 00:01:17
【问题描述】:

我想更改下拉菜单中代码选择的选项

$('#ddd option[value="1"]').prop('selected', true);

但它不适用于带有 jquery 的 mobile phonegap 应用程序。
我想我需要刷新 #ddd 控件,但我无法使用 jquery 成功。
我尝试将 jquery 和 jquery mobile 一起使用,但我无法解决。
如何使用 jquery(不是 jquery mobile)刷新 #ddd 控件?
谢谢...

【问题讨论】:

    标签: jquery jquery-mobile cordova drop-down-menu


    【解决方案1】:

    你可以试试这个:

    $('#ddd').val('1'); 
    

    上面将设置选定的值<option value="1"></option>

    你也可以触发change事件:

    $('#ddd').val('1').change(); 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-07
      • 2012-05-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多