I want to implement a dark mode in my website. I have a switch with a checkbox input and I want to run a javascript function when it is checked so that the colors change. Here is the html code. I don't know if the CSS code is needed for this.
<label class="switch">
<input type="checkbox" id="darkmode">
<span class="slider round"></span>
</label>