Just curious if anyone has insight into this jQuery behavior, which seems buggy to me.
I have an empty select form element that I want to append options to, one of which is hidden by wrapping it in a span element with display style set to none.
snippet 1 - appends the options but ignores the span element:
var myOptions = '<option value="1">1</option><span style="display:none;"><option value="2">2</option></span>';
$('#mySelect').append(myOptions);
snippet 2 - works as intended:
var myOptions = '<option value="1">1</option><option value="2">2</option>';
$('#mySelect').append(myOptions);
$('#mySelect').find('options:eq(1)').wrap('<span style="display:none;"/>');