return Json function is not updating my drop down lists

前端 未结 1 1244
不知归路
不知归路 2021-01-27 06:03

I have a view which has a populated dropdownlist, I have added a button so the user can add a new dropdownlist value in a jquery modal, so when the user clicks to add the new dr

相关标签:
1条回答
  • 2021-01-27 06:55

    Try This

    var select = $("#dropdownid");
    select.empty();
      $.each(data, function (index, itemData) {
        select.append($('<option/>', {
          value: itemData.Value,
          text: itemData.Text
         }));
      });
    
    0 讨论(0)
提交回复
热议问题