Swapping the values of two HTML ` elements once you've swapped the values. – Richard Deeming Nov 30 '21 at 15:49

0

Here is another example, that works without the buttons. It assigns values to each option instead.

function swap_selections(name1, name2) {
    let ob1 = document.getElementById(name1)
    let ob2 = document.getElementById(name2)
    let val1 = ob1.value;
    let val2 = ob2.value;
    if(val2 != "0") {
        if(val1 == "1") {
            if(val2 != "2") 
                ob2.value = "2";
        } else if(val1 == "2") {
            if(val2 != "1") 
                ob2.value = "1";
        }
    }
}

function my_onload() {
    document.getElementById("select1").addEventListener("change", 
        event => { swap_selections("select1", "select2"); });
    document.getElementById("select2").addEventListener("change",
        event => { swap_selections("select2", "select1"); });
}
<body onload="my_onload()">

<div class="bigtext">Currency 1:</div>
<div class="smalltext">Your input currency</div>
<select id="select1">
    <option value="0"></option>
    <option value="1">EUR</option>
    <option value="2">USD</option>
</select>

<div class="bigtext">Currency 2:</div>
<div class="smalltext">The currency you want to convert to</div>
<select id="select2">
    <option value="0"></option>
    <option value="1">EUR</option>
    <option value="2">USD</option>
</select>
    
</body>