I'm having an issue with <optgroup>
in Opera using jQuery. First, here's the code:
// returns a jQuery optgroup object
function getSpaceOptGroup(locationName) {
var location = locations.first(function(l) {
return l.name == locationName;
});
var optGroup = $("<optgroup label='" + location.name + "'></optgroup>");
$.each(location.spaces, function(i,x) {
optGroup.append("<option value='" + x.id + "'>" + x.name + "</option>");
});
return optGroup;
}
This function returns to a simple apend()
. What happens is that only the <opgroup>
label appears and none of the options, but only in Opera. It works in FF, Safari, and IE. Any help is much appreciated.