How to set the 'selected option' of a select dropdown list with jquery

后端 未结 6 1508
南笙
南笙 2021-01-31 09:07

I have the following jquery function:

$.post(\'GetSalesRepfromCustomer\', {
    data: selectedObj.value
}, function (result) {
    alert(result[0]);
    $(\'sele         


        
6条回答
  •  不知归路
    2021-01-31 09:50

    $(document).ready(function() {
      $('#YourID option[value="3"]').attr("selected", "selected");
      $('#YourID option:selected').attr("selected",null);
    });
    
    

提交回复
热议问题