When I populate a dropdown by using for loop and json object ,it adds undefined option in dropdown at end .
for (var i in PriceRanges[purpose]) {
var r = PriceRanges[purpose][i];
html += '<option value="' + r.id + '">' + r.text + '</option>';
}
Where PriceRanges is my json object.
Thanks for any help in advance.
just check for undfied like this and than add