aboutsummaryrefslogtreecommitdiffhomepage
path: root/web/src/tabs.html
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/tabs.html')
-rw-r--r--web/src/tabs.html30
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>