how to use each loop in jquery

1 Answers

  1. Aditya Kumar Patel
    use each loop in jquery
    7/7/2018 8:17:00 AM

    Try to use it:


    var subItems = "";
    $.getJSON("@Url.Action("SubCategory", "Home")", { id: val }, function (data) {
       $.each(data, function (index, item) {
              subItems += "<option value='" + item.Value + "'>" + item.Text + "</option>"
                    });
                    $("#SubCategoryID").html(subItems); 
       });


Leave a answer

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

you may also like