title: Power button (CSS change via button click )
body: <p>Working on an HTML project.</p>
  
  <p>Having issues with making a JavaScript that will work for what I'm looking for:</p>
  
  <p>When a button is clicked, I want the <code>::before</code> css to change </p>
  
  <p>and the <code>::after</code> css to change as well.</p>
  
  <p>And when the button is clicked again, revert the css back to normal.</p>
  
  <p>Basically making it seem as if a light on either side was glowing then the other glows when clicked.</p>
  
  <p><a href="https://i.stack.imgur.com/A1Kib.png" rel="nofollow noreferrer">Example</a></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>$('button').on('click', function(event) {
    if ($('.power::before').hasClass('on') == false) {
      $('.power::before').addClass('on');
      $(this).text('Small');
    } else {
      $('.power::before').removeClass('on');
      $(this).text('Big');
    }
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.power {
    position: absolute;
    width: 180px;
    height: 60px;
    right: 20px;
    bottom: 15px;
    border-radius: 4px;
    box-shadow: inset 2px 2px rgba(255, 255, 255, 0.1), inset -2px -2px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(255, 255, 255, 0.2), 0 4px 10px rgba(0, 0, 0, 0.4);
    border: 2px #000 solid;
  }
  
  .power::before {
    content: " Standby ";
    position: absolute;
    font-family: Arial;
    font-size: 10px;
    color: #000;
    width: 5px;
    height: 5px;
    top: 38px;
    left: 100px;
    bottom: 30px;
    background: #a52a2a;
    border: 1px #111 solid;
    border-radius: 50%;
    line-height: 5px;
    text-indent: 12px;
    text-shadow: 0 1px #000;
  }
  
  .power::after {
    content: " Power ";
    position: absolute;
    font-family: Arial;
    font-size: 10px;
    color: #000;
    width: 5px;
    height: 5px;
    top: 18px;
    left: 100px;
    bottom: 30px;
    background: #7cfc00;
    box-shadow: 0 0 10px #7cfc00, 0 0 5px #7cfc00;
    border: 1px #7cfc00 solid;
    border-radius: 50%;
    line-height: 5px;
    text-indent: 12px;
    text-shadow: 0 1px #000;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;nav class="power"&gt;
    &lt;button&gt;button click&lt;/button&gt;
  &lt;/nav&gt;</code></pre>
  </div>
  </div>
  </p>