I would like to replace whole content in my selectbox.
Here's what I have:
My new content looks like:
[Object, Object, Object]
0: Object
Label: "A"
Value: 1
1: Object
Label: "B"
Value: 2
and I tried replace it this way:
var $el = $("#mySelectBoxId");
$el.empty();
$.each(newOptions, function (value, key) {
$el.append($("<option></option>")
.attr("value", value).text(key));
});
And the result looks like list of Objects.