Set selected value of dropdown in jquery

In this tutorial, I am going to show with you how you can set the selected value of dropdown in jquery with an Html control.  In this process, you need to call the Drop-Down id and use val() function with 'Selectedvalue' as the parameter.

So, Let's get started.

Step 1:
For Html Control
After success receive the value in a variable and set it

              <select id="ddlCity" class="form-control"></select>

        success: function (res)
            var getval = res.d;
            document.getElementById('ddlCity').value = getval.city_sk;
For control
<asp:DropDownList runat="server" ID="ddlcity" />
Don't Forget to use jquery library, if you are using ajax process

Post a Comment

Post a Comment (0)

Previous Post Next Post