mirror of
https://github.com/modmii/modmii.github.io.git
synced 2024-11-15 04:45:12 +01:00
26 lines
869 B
Plaintext
26 lines
869 B
Plaintext
|
|
||
|
<script>
|
||
|
let tabcontent = document.getElementsByClassName("blanktabcontent");
|
||
|
let tablinks = document.getElementsByClassName("tablinks");
|
||
|
|
||
|
function openTab(evt, tabName) {
|
||
|
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";
|
||
|
evt.currentTarget.className = evt.currentTarget.className.replace("btn--info", "btn--primary");
|
||
|
}
|
||
|
|
||
|
// Get the element with id="defaultOpen" and click on it
|
||
|
document.getElementById("defaultOpen").click();
|
||
|
</script>
|