title: change which toggle is selected on page load
body: <p>I'm trying to figure out a solution where i can select which toggle is displayed on page load.   At the minute, when the page loads, it is set to Pay Annually.  How would i change my code so that it is set to Pay Monthly on page load?.  I want the ability to quickly swap them for a/b tests.</p>
  <p>I've attached my CodePen also - <a href="https://codepen.io/jonimmsCC/pen/mdmxrVa" rel="nofollow noreferrer">CodePen</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>$(document).ready(function() {
    var checkBoxes = $("input[name='toggle']");
    toggle();
    $("#toggle").click(function() {
      toggle();
    });
  
    function toggle() {
      if (checkBoxes.prop("checked")) {
        $('#coreMonthlyText,#coreMonthlyPrice').show();
        $('#coreAnnuallyText,#coreAnnuallyPrice').hide();
  
      } else {
        $('#coreMonthlyText,#coreMonthlyPrice').hide();
        $('#coreAnnuallyText,#coreAnnuallyPrice').show();
      }
    }
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.pricing-box {
    background: red;
    padding: 25px;
    width: 30%;
  }
  
  .row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }
  
  .column {
    display: flex;
    flex-direction: column;
    flex-basis: 100%;
    flex: 1;
  }
  
  .toggle-switch {
    cursor: pointer;
    background-color: gray;
    display: inline-block;
    border: 0;
    padding-left: 0;
    padding-right: 0;
  }
  
  .toggle-switch input {
    display: none;
  }
  
  .toggle-switch,
  .toggle-switch span {
    border-radius: 35px;
    border-style: solid;
    border-color: transparent;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
  
  .toggle-switch span {
    border-width: 2px;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .toggle-switch input:checked+span+span,
  .toggle-switch input+span {
    border-color: #444;
    background-color: white;
  }
  
  .toggle-switch input+span+span,
  .toggle-switch input:checked+span {
    background-color: transparent;
    border-color: transparent;
  }
  
  #coreMonthlyText,
  #coreMonthlyPrice,
  #coreAnnuallyText,
  #coreAnnuallyPrice {
    display: none;
  }
  
  #proMonthlyText,
  #proMonthlyPrice,
  #proAnnuallyText,
  #proAnnuallyPrice {
    display: none;
  }</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;div class="pricing-box"&gt;
    &lt;div class="row"&gt;
      &lt;div class="column"&gt;
        &lt;div class="core"&gt;
          &lt;h2&gt;Core&lt;/h2&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="column"&gt;
        &lt;div id="coreAnnuallyPrice" class="coreAnnuallyPrice"&gt;
          $2,399/yr&lt;br /&gt; Normally $3,588/yr
        &lt;/div&gt;
        &lt;div id="coreMonthlyPrice" class="coreMonthlyPrice"&gt;
          $299/pm&lt;br /&gt; first 2 months free
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
  
    &lt;label for="toggle" class="toggle-switch"&gt;
          &lt;input class="toggle-button" id="toggle" type="checkbox" name="toggle" data-checked="coreAnnuallyPrice,coreAnnuallyText" data-not-checked="coreMonthlyPrice,coreMonthlyText"&gt;
          &lt;span&gt;pay annually&lt;/span&gt;
          &lt;span&gt;pay monthly&lt;/span&gt;
      &lt;/label&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>