title: Change class with data-target
body: <p>I have tried this:</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>$(".font").click(function() {
    var target = $($(this).data("target"));
    $("#text").addClass(target);
  })</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.pap {
    font-family: Papyrus;
  }
  
  .ar {
    font-family: Arial;
  }
  
  .hel {
    font-family: Helvetica,
  }</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;button class="font" data-target=".pap"&gt;Papyrus&lt;/button&gt;
  &lt;button class="font" data-target=".ar"&gt;Arial&lt;/button&gt;
  &lt;button class="font" data-target=".hel"&gt;Helvetica&lt;/button&gt;
  
  &lt;div id="text" class="ar"&gt;Text&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Unfortunately, it doesn't work to change the classes by clicking a button. Is it just a little mistake or does this logic not work at all?</p>