jQuery mobile not displaying correct selected item in list

后端 未结 1 860
梦如初夏
梦如初夏 2020-12-22 11:34

I have a select list. I am using jQuery to update the selected item. The displayed item in the box isn\'t updating when I change the selected value. In the following example

相关标签:
1条回答
  • 2020-12-22 12:14

    First of all, refrain from using .ready() in jQuery Mobile.

    When selecting an option programmatically, you need to re-ehance selectmenu widget.

    $("#id").prop("selected", true);
    $("select_id").selectmenu("refresh");
    

    Demo

    0 讨论(0)
提交回复
热议问题