diff options
author | johannst <johannst@users.noreply.github.com> | 2022-11-13 14:13:35 +0000 |
---|---|---|
committer | johannst <johannst@users.noreply.github.com> | 2022-11-13 14:13:35 +0000 |
commit | 2dfbc312e6ccb88f838170d8e777d48aacde2ff5 (patch) | |
tree | a4a83435e10a7ad38f454a30cbd7b30640cd1a7d /web/src/tabs.html | |
parent | ccbbcafbc7337c8d7a785b9034716618dce36e4d (diff) | |
download | notes-2dfbc312e6ccb88f838170d8e777d48aacde2ff5.tar.gz notes-2dfbc312e6ccb88f838170d8e777d48aacde2ff5.zip |
deploy: 026d679006e5d470bacdc74bb3082072edf31e36
Diffstat (limited to 'web/src/tabs.html')
-rw-r--r-- | web/src/tabs.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/web/src/tabs.html b/web/src/tabs.html new file mode 100644 index 0000000..af3f56a --- /dev/null +++ b/web/src/tabs.html @@ -0,0 +1,30 @@ +<script> +const showTab = (E, T) => { + const TABS = Array.from(document.getElementsByClassName("content")); + TABS.forEach(T => { + T.style.display = "none"; + }); + + document.getElementById(T).style.display = "block"; +}; + +window.onload = () => { + document.getElementById("bTab1").onclick = (E) => { + showTab(E, "tTab1"); + }; + document.getElementById("bTab2").onclick = (E) => { + showTab(E, "tTab2"); + }; +} +</script> + +<button type="button" id="bTab1">Tab1</button> +<button type="button" id="bTab2">Tab2</button> + +<div id="tTab1" class="content" style="display: block;"> + <p>Some content goes here ...</p> +</div> + +<div id="tTab2" class="content" style="display: none;"> + <p>... and there.</p> +</div> |