jQuery to retrieve and set selected option value of html select element

前端 未结 9 1382
醉梦人生
醉梦人生 2020-11-28 21:15

I am attempting to retrieve and set the selected value of a select element (drop down list) with jQuery.

for retrievel i have tried $(\"#myId\").find(\':select

9条回答
  •  忘掉有多难
    2020-11-28 22:18

    When setting with JQM, don't forget to update the UI:

    $('#selectId').val('newValue').selectmenu('refresh', true);
    

提交回复
热议问题