Can switch statements only be used for two statements and also how do i connect my switch statements to my radio buttons so whenever i choose a certain option with the radio button it changes, i’m confused
@rootJan 29.2020 — #Switch..case can be text tests, numeric tests to match specific terms and you have as many as you want.
Note that people often try using these in place of IF conditionals when the IF should be used, you will get odd results when you try to evaluate a bool as the case element of the statement.
Here is a tutorial : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch
@SempervivumJan 30.2020 — #@gavin505#1613684how do i connect my switch statements to my radio buttons so whenever i choose a certain option with the radio button it changes[/quote] By chance I coded a solution for this requirement some days ago : <script> function einblenden() { const rbGroups = document.querySelectorAll('.radioGroup'); const idxSel = document.getElementById("Standort_mod").selectedIndex; for (let i = 0; i < rbGroups.length; i++) { const theGroup = rbGroups[i]; if (theGroup.getAttribute('data-idxsel') == idxSel) { theGroup.style.display = 'block'; } else { theGroup.style.display = 'none'; } } } </script>