Iām working on a Lightmode/Darkmode selector for my website. I can't figure out how to set the body tag to the value of a select element.
So far, here's what I have.
<body>
<select name="ld" id="ld">
<option value="normal" selected >Light mode</option>
<option value="darkmode" >Dark mode</option>
</select>
</body>
and the CSS:
body {
font-family: sans-serif;
text-align: center;
cursor: default;
}
#darkmode {
background-color: black;
color: white;
}