[Solved] Store Dropdown list old values and re populate them


Please tell me how can i store the old value of the drop down list.

One possibility is to store them in a temporary javascript array using the .map() function:

var oldValues = ​$('#myselect option')​.map(function() {
    return { value: $(this).val(), text: $(this).text() };
});

or completely clone the dropdownlist using the .clone() method:

var dropdown = $('#myselect').clone(true);

and later restore it back.

solved Store Dropdown list old values and re populate them