title: How do i switch the button icon from nightmode to day mode?
body: <p>In the below code I have linked some js/jQuery to elements in my html which should be self explanatory. I have console logged each if else statement to see what the issue is and it seems to be stuck on the first if statement.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function toggleDisplay() {
  var icon = document.getElementById("togglebutton");
  var night_icon = 'assets/Feed_Toggle_Night.png'
  var day_icon = 'assets/Feed_Toggle_Day.png'
  $("displaytog").on("click", () =&gt; {
      if (icon.src == night_icon) {
          icon.src = day_icon;
          console.log("success1");
      }else {
          icon.src = night_icon;
          console.log("success2");
      }
  })
  }
  toggleDisplay();</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;displaytog&gt;
    &lt;img src="assets/Feed_Toggle_Night.png" id="togglebutton"/&gt;
  &lt;/displaytog&gt;</code></pre>
  </div>
  </div>
  </p>