title: Background Color Change Switch Not Working
body: <p>I'm trying to make a dark/light theme. When I click to flip into light, the function runs. but <code>darken();</code> seems to be ignored. Am I missing something? no error messages.</p>
  <pre><code>&lt;label class=&quot;switch&quot;&gt;
      &lt;input type=&quot;checkbox&quot;&gt;
  &lt;span class=&quot;slider round&quot; onclick=&quot;contrast();&quot;&gt;&lt;/span&gt;
  </code></pre>
  <pre><code>var m = 1
  
  function lightup() {
      document.getElementById('header-wrap').style.backgroundColor = &quot;white&quot;
  }
  
  function darken() {
      document.getElementById('header-wrap').style.backgroundColor = 'black'
  }
  
  function contrast() {
      if (m = 1) {
          m = 2
          lightup();
      }
      else if (m = 2) {
          m = 1
          darken();
      }
  }
  </code></pre>
  <p><code>contrast();</code> and <code>lightup();</code> both fire as intended. <code>darken();</code> does not.</p>