I am working on a j2ee application. In my application I have a drop-down list(or Select element). I want to populate this drop-down list with JSON data as a Ajax response.
We can populate dropdown like below . it's very easy for you all i guess.
var options = $("#options"); $.getJSON("/Country/GetAll/", function(response) { $.each(response, function() { options.append($("").val(this.Id).text(this.Name)); }); });