Basically what I am wanting to do is take the variable named FROM and swap it with the variable named TO and vice visa, the reason for this is to allow the user to press a button which swaps the variables over when pressed. Exactly how it does when you press the swap button on google translate. Below is the code for the variables ect, but I have no idea on how to code the button so they swap over so to speak.
function save_options_from() {
var select = document.getElementById("FROM");
var FROM = select.children[select.selectedIndex].value;
localStorage["default_currency"] = FROM;
var
}
function save_options_to() {
var select = document.getElementById("TO");
var TO = select.children[select.selectedIndex].value;
localStorage["default_currency_to"] = TO;