title: Stop beginning transitions
body: <p>(Example) So, I have transitions for let's say, the <code>&lt;p&gt;</code> element of my site. <code>.invert</code> switches it from red to blue. I have a JS function named <code>invert()</code> and it runs right away, but I want <code>invert()</code> to switch it without transitions if it's done on page load.</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>elm = document.getElementById("invert");
  
  function invert() {
    elm.classList.toggle("invert");
  }
  
  invert();</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>p {
    color: red;
    font-size: 150%;
    transition: color 1s;
  }
  
  p.invert {
    color: blue;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p id="invert"&gt;peanut&lt;/p&gt;
  &lt;button onclick="invert()"&gt;butter&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>The code snippet isn't doing it but you get the idea! :P Just imagine there's a transition when the code runs, when I call <code>invert()</code> so that it actually switches from red to blue. I can give you the code to the site if you want.</p>
  <p>Help would be much appreciated! Thank you for your time!</p>