Select Not Multiple, but in the code with many Options Selected, Loses the Selected Values when the JQuery Changes the Select To Multiple.

Select Not Multiple, but in the code with many Options Selected, Loses the Selected Values when the JQuery Changes the Select To Multiple.

For example:

I have the following code->

<select id="selectTest">

<option value="1" selected="selected">Number 1</option>
<option value="2" selected="selected">Number 2</option>
<option value="3">Number 3</option>
<option value="4" selected="selected">Number 4</option>

</select>

Since its not multiple its not going to show all the 3 options selected, so I created a little button with the easy statement in JQuery

$('select#selectTest').attr("multiple","multiple");


it is working, it makes the Select Multiple, it expands the Select and make the items selectable, but on the other hand it does not show the already selected options.

What do I do to fix this? Thank you.