我无法在选择框中选择具有特定值的选项。这是我正在使用的代码:
$('#group_e option[value="'+parameters.group+'"]').attr("selected", "selected");
我对 parameters.group
值进行了 console.log()
操作,因此我知道它等于我尝试选择的选项。
我正在使用 Phonegap 和 jQuery Mobile 在 XCODE 模拟器中执行此操作。
最佳答案
您需要刷新选择以反射(reflect)更改值后的更改:
$('#group_e').selectmenu('refresh', true);
关于javascript - 无法在 jQuery mobile 中选择具有特定值的选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23561292/