How to select an option in a jQuery ui selectmenu dynamically?

后端 未结 6 1297
别跟我提以往
别跟我提以往 2021-02-18 21:44

After changing a menu from a regular select to a jQuery selectmenu, I can no longer select options in it programatically. Is there a way to do this?

The code to select

6条回答
  •  难免孤独
    2021-02-18 22:23

    You could additionally trigger the change event handler by adding a change call:

    $('#ListId').selectmenu("value", value);
    $('#ListId').selectmenu("change"); // Add this for a change event to occur
    

提交回复
热议问题