title: Keep Class toggled after Page Refresh
body: <p>I am currently working with a sliding button in CSS, HTML, and JQuery. I have a basic understanding of JQuery but an quite knowledgeable in CSS &amp; HTML. I have had a slight problem though, whenever you press the button it works fine, but upon page reload it reverts back to the before toggled state. How might I fix this issue, open to any solution preferably client side?
  (Below is a snippet of my button and the code alongside it)
  <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>$(document).ready(function() {
    $('.toggle-menu-lang-cont').click(function() {
      $('.handle').toggleClass('slide');
      $('.toggle-menu-lang-cont').toggleClass('color-swap');
    });
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    background-color: black;
  }
  
  .toggle-menu-lang-cont {
    position: absolute;
    top: 2.5vw;
    right: 5vw;
    max-width: 3.5vw;
    width: 3.5vw;
    max-height: 1.5vw;
    height: 1.5vw;
    border-radius: 1vw;
    z-index: 5;
    background-color: #fff;
    transition: all 1s;
    transform: scale(1);
  }
  
  .handle {
    position: absolute;
    top: 0.15vw;
    right: .25vw;
    background-color: #0282E4;
    width: 1.25vw;
    height: 1.25vw;
    border-radius: 100%;
    filter: drop-shadow(0vw .15vw .15vw rgb(0, 0, 0, 0.6));
    transition: all 1s;
    transform: scale(1);
  }
  
  .slide {
    position: absolute;
    right: 2vw;
    background-color: white;
    transition: all 1s;
  }
  
  .color-swap {
    background-color: #0282E4;
    transition: all 1s;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
    &lt;title&gt;Code Project&lt;/title&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
    &lt;link rel="stylesheet" type="text/css" href="stylesheet.css" &lt;script src="http://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E=" crossorigin="anonymous"&gt;
    &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;section class="toggle-menu-lang-cont"&gt;
      &lt;div class="toggle-btn"&gt;&lt;/div&gt;
      &lt;div class="handle"&gt;&lt;/div&gt;
    &lt;/section&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>