How to add more value to existing class (wordpress)?

Solution:

  1. Dont use - in your class name.
  2. id must be unique so dont use id when iterate over each text box. Use class.
  3. If you have only 1 textarea no need to iterate, just catch DOM element and apply your css.
  4. setAttribute replace your whole previous class so if you want to add new class just use addClass

 

jQuery('#yith-ywraq-default-form .form-row textarea[class="inputtext"]').each(function() {
  this.setAttribute('class', 'inputtext wsqmylogin');
  //jQuery(this).addClass('inputtext wsqmylogin');
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<form id="yith-ywraq-default-form">
  <p class="form-row" id="message_field" data-priority="">
    <textarea name="message" class="inputtext" id="message" placeholder=""></textarea>
  </p>
</form>