Widget:Guides/PlatformSwitcher: Difference between revisions

No edit summary
No edit summary
Line 1: Line 1:
<form>
<form>
   <fieldset>
   <fieldset id="platform-switcher">
     <legend>Select your operating system:</legend>
     <legend>Select your operating system:</legend>


Line 24: Line 24:
const containers = document.querySelectorAll('.platform-specific');
const containers = document.querySelectorAll('.platform-specific');
switch_thing('windows');
switch_thing('windows');
const fieldset = document.getElementById("platform-switcher");
for (const elem of fieldset.querySelectorAll('input')) {
  elem.addEventListener('change', () => console.log(elem.value))
}


function switch_thing(value) {
function switch_thing(value) {