I'm using this method to add the value and the text to the option, but I need to add also the selected attribute. How can i do this? this is my method...:
$.each(items, function (i, item) {
$('#mySelect').append($('<option>', {
value: item.value,
text : item.text
// is it possible to add here something like this: select: "selected"
}));
});