this code works fine in FF, not in IE.
var target = $("#targetSelectBox")
var vals = values.split(";");
for (var i = 0; i < vals.length; i++) {
var parts = vals[i].split(":");
target.append($('<option />').val(parts[0].trim()).text(parts[1].trim()));
}
You’re missing a semi-colon after the first line:
Be sure that this selector is actually finding your element:
We’ll also need to see the full portion of your code, including what
valuesis to begin with. Additionally, make sure that jQuery is properly referenced, and you might even consider wrapper your innertargetreference in the jQuery wrapper as well:Functional example online: http://jsbin.com/ibeci/edit