title: Jquery/Javascript ( Convert from ID to Class )
body: <p>I did this script. But now i need to convert these id to classes because should I put it in other elements of the page.</p>
  <h1>card ---&gt; .card</h1>
  <h1>flip ---&gt; .flip</h1>
  <pre><code> var init = function() {
        var card = document.getElementById('card');
        
        document.getElementById('flip').addEventListener( 'click', function(){
          card.toggleClassName('flipped');
        }, false);
      };
      
      window.addEventListener('DOMContentLoaded', init, false);
  </code></pre>
  <p>Can you help me?</p>
  <p>SOLUTION :</p>
  <pre><code>$(function() {
    var card = $('.card');
    
    $('.flip').on( &quot;click&quot;, function(){
      card.toggleClass('flipped');
      return false;
    });
  });
  </code></pre>