I am adding drop down boxes to a div using javascript on a user action, if these boxes are assigned a value by the user then the user adds more boxes the values previously selected are cleared.

Could anyone please explain why this is happening?

It does not happen if an option is selected in the HTML when the page is loaded.