title: Change class on each click
body: <p>When we click on the span <code>referent-R</code> it has the <code>checked</code> class. This works.
  However when we click another time on the same <code>span</code> I would like to remove the <code>checked</code> class. It should radio button/checkbox behavior.</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>$('.referent-R').click(function() {
    if ($(this).is(':checked')) {
      $(this).removeClass('checked');
      $(this).addClass('unchecked');
    } else {
      $(this).removeClass('unchecked');
      $(this).addClass('checked');
    }
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.referent-R {
    font-family: Roboto, sans-serif;
    content: 'R';
    font-weight: bolder;
    font-size: 25px;
  }
  
  .referent-R.checked {
    color: rgb(76, 10, 89);
  }
  
  .referent-R.unchecked {
    color: rgb(200, 200, 200);
  }</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;span class="referent-R" title="référent"&gt;&lt;/span&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks a lot !!</p>