Here is the line i am trying to change.
<a class="weatherwidget-io" href="https://forecast7.com/en/n45d88170d50/dunedin/" data-label_1="DUNEDIN" data-label_2="WEATHER" data-theme="original" >DUNEDIN WEATHER</a>
I am trying to change the "original" data-theme="original"
with "dark" when a function is triggered.
Here is my function
function darkmode() {
document.body.classList.toggle("dark-theme")
document.body.classList.toggle("logo_paw_dark")
document.getElementsByName("data-theme").innerHTML = "dark";
}
I tried getting the element by the name but did not work and neither did with using id