function updateSelector()
{
var fieldSelector = $("select:not(#project):not(#allNo):not(#availableNo)");
var selected;
$("#availableNo").empty().append($("#allNo").clone());
fieldSelector.each(function() {
$("#availableNo"+" option[value="+$(this).val()+"]").remove();
});
fieldSelector.each(function() {
selected = $("option:selected", this);
$(this).empty().append(selected);
$(this).append($("#availableNo option").clone());
if($("option",this).length ==1)
$(this).append("<option></option>");
});
}
The above code works fine, but in IE it seems that it will behave strangely if there is an instruction after it (no problem, if there is no statdment after it, and only IE has problems with it).
If I warn (in the last line), the selected parameter will be moved by 1 index.
For example, if there is 1-4, choice 1 will lead to choice 2; if you select 2, it will be 3.
Does anyone know why or what causes this?
I am really disappointed with this.
source
share