It is impossible for the values added by JavaScript to stay. When you refresh the page it is like walking up to the blackboard and erasing everything to start over again. All the JavaScript variables are reset on the page and the page goes back to its default state.
Only thing you have to work with is storing the values in a cookie and loading them when the page loads again.
php, JSP and other server-side mechanisms are a different thing. If you can communicate the changes and persist them back to the server, you can re-create the options on the server before sending the page to the browser.