title: Add class to previous element using jquery
body: <p>I am adding classes namely hide_some_features,show_some_features in each loop. Now i want to add class to feature_suffix having next only hide_some_features class. I tried with  <code>$(this).closest('.feature_suffix').addClass('test-class');</code> which is not working.</p>
  
  <pre><code> $('.variations_form input:radio[name=attribute_pa_1]').each(function() {
       if (jQuery.inArray($(this).attr('data-feature-value'), disabledFetaureValue) &lt; 0) {
           $(this).closest('.cc-selector').addClass('hide_some_features');
           $(this).closest('.feature_suffix').addClass('test-class');
       } else {
           $(this).closest('.cc-selector').addClass('show_some_features');
       }
   })
  </code></pre>
  
  <p>;
  <a href="https://i.stack.imgur.com/O71Xi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O71Xi.png" alt="enter image description here"></a></p>
  
  <p>I want to add class to highlighted place </p>