title: How to add a class to element with jQuery
body: <p>I am using a jQuery code snippet to scan dynamic text (.price-tag) and then use that text to add a class to an element (.w-dyn-item -> .w-dyn-item free).</p>
  
  <p>My problem is that I not only have a .price-tag, but also a .type-tag .color-tag .shape-tag and I'd like to change the code so that it scans the text of all of these classes and then adds all of them as classes to w-dyn-item (.w-dyn-item -> .w-dyn-item free book green circle)</p>
  
  <p>I would appreciate any help &lt;3</p>
  
  <pre><code>&lt;div class="courses-list-item w-dyn-item free"&gt;
  
  &lt;div class="price-tag"&gt;Free&lt;/div&gt;
  
  &lt;div class="type-tag"&gt;Book&lt;/div&gt;
  
  &lt;div class="color-tag"&gt;Green&lt;/div&gt;
  
  &lt;div class="shape-tag"&gt;Circle&lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <pre><code>jQuery
  ( '.w-dyn-item .price-tag' ).each
  (
      function( index, element )
      {
          var _this = jQuery( element );
              _this.parent().addClass( _this.text().toLowerCase() );
      }
  );
  </code></pre>