I am adding new options to a select menu by the following way:
var options1 = {
val1 : 'text1',
val2 : 'text2'
};
$.each(options1, function(val, text) {
$('#SelectMenu').append( new Option(text,val) );
});
How can we set the properties like a default selected option and optgroup options available in JQM?
Live Example: http://jsfiddle.net/rULKH/5/
JS