[jQuery] Odd behavior in IE with select boxes

[jQuery] Odd behavior in IE with select boxes


I'm seeing some odd behavior in IE with my SELECT boxes. In the
static HTML, I have the following:
<label for="type" class="dialog first">Select Type</label>
<select id="type" class="dialog first">
    <option selected value="">--- Type ---</option>
</select>
In JavaScript, I have the following:
$.get("create.do", params,
    function(data) {
        if( $('option', idSel).length > 0 ) {
            var firstOption = $('option', idSel);
            $(idSel).replaceWith(data);
            $(idSel).prepend(firstOption);
            $(idSel).removeAttr('disabled');
        }
    }
);
The data coming back is actually a snippet of HTML, like this:
<select id="type"><option value="1">In</option><option value="2">Out</
option></select>
Note it does not contain a "selected" attribute. What I want is to
merge the data with the static HTML so in essence I would have:
<label for="type" class="dialog first">Select Type</label>
<select id="type" class="dialog first">
    <option selected value="">--- Type ---</option>
    <option value="1">In</option>
    <option value="2">Out</option>
</select>
However, in IE, the "selected" attribute always seems to get set on
the "In" instead.
Is this yet another odd thing with IE? Is there something else I
should be doing to get the desired results?
Thanks in advance.