From 132524b1c74f34cda16122b8f43d885a846c4589 Mon Sep 17 00:00:00 2001 From: Xaloc Date: Fri, 27 Aug 2021 00:34:28 +0200 Subject: [PATCH] make text button mode toggle when pressed --- index.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 538444a..dbcd4e9 100644 --- a/index.html +++ b/index.html @@ -28,7 +28,7 @@

Data from IRF Kiruna

- +

Latest image from the All Sky camera

@@ -65,7 +65,14 @@ function darkMode() { var ele = document.body; ele.classList.toggle("dark"); + var x = document.getElementById("modeBtn"); + if (x.innerHTML === "Dark Mode: Off") { + x.innerHTML = "Dark Mode: On"; + } else { + x.innerHTML = "Dark Mode: Off"; + } } + async function api(){ const res = await fetch('https://www.spaceweather.se/forecast/kp/latest.json'); const data = await res.json();