Widget:Guides/PlatformSwitcher: Difference between revisions

No edit summary
No edit summary
Line 23: Line 23:
<script type="module" defer>
<script type="module" defer>
const containers = document.querySelectorAll('.platform-specific');
const containers = document.querySelectorAll('.platform-specific');
hide_everything();
switch('windows');


function hide_everything() {
function switch(value) {
   containers.forEach(x => x.style.display = "none");
   for (const x of containers) {
    x.style.display = "none"
  }
  document.querySelector('.' + value).style.display = "block";
}
}
</script>
</script>