modmii.github.io/Support/Guide/side_spoiler_script.001
2023-03-10 03:37:08 +02:00

27 lines
915 B
Plaintext

<script>
function openTab(tabGroup, tabName) {
let tabcontent = document.getElementsByClassName(tabGroup);
let tablinks = document.getElementsByClassName("tablinks");
let element;
for (element of tabcontent) {
element.style.display = "none";
}
for (element of tablinks) {
element.className = element.className.replace("btn--primary", "btn--info");
if (!element.className.includes('btn--info'))
element.className += " btn--info";
}
document.getElementById(tabName).style.display = "block";
event.currentTarget.className = event.currentTarget.className.replace("btn--info", "btn--primary");
}
// Get the element with id="defaultOpen" and click on it
//document.getElementById("defaultOpen2").click();
document.getElementById("defaultOpen").click();
</script>