To work around this problem, store the
selectedIndex property value of the option element before you clone the
ComboBox control or the
ListBox control. Then, set the
selectedIndex property value of the cloned control with the stored
value.
For example, you may use the following code to clone the
oCombobox
ComboBox control:
var clonedCombobox = oCombobox.cloneNode(true);
To work around the problem, modify your code as follows:
var i = oCombobox.selectedIndex;
var clonedCombobox = oCombobox.cloneNode(true);
clonedCombobox.selectedIndex = i;