I’m having some problems to compare two strings in jQuery:
var option = "";
$.each(data, function(key, value) {
option += "<option ";
if(selected == value) {
option += "selected";
}
option += ">" + value + "</option>";
});
selected and value are the same strings.
Is there an another way to compare two strings or could it be, that selected and value are different types?
You have to consider this: