title: How to create a jQuery function to toggle dark mode?
body: <p>I'm designing a dark mode for my website. Given I have a lot of written content, that would be especially helpful for evening reading. I have a toggle and have borrowed a function that seems to work so far:</p>
  
  <pre><code>$(function() {
    $(".switch").click(function() {
      $("#canvas-wrapper").css("background", "#222");
      $("p").css("color", "#DDD");
      });
  });
  </code></pre>
  
  <p>I want the user to toggle these changes on and off as desired. However, when I attempt to add another line - defining a css change for another element - the function only applies the style to the first <code>#canvas-wrapper</code> element. Everything thereafter is ignored. </p>
  
  <p>Is my syntax incorrect later in the function? Also, I need to write the function in a way that returns the CSS to its original state, should the user deactivate the toggle. How would I approach this? </p>
  
  <p>I'm quite poor with jQuery and haven't had a ton of experience with the language.</p>