Solution:
- Dont use
-
in your class name. id
must be unique so dont useid
when iterate over each text box. Useclass
.- If you have only 1
textarea
no need to iterate, just catch DOM element and apply your css. setAttribute
replace your whole previous class so if you want to add new class just useaddClass
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>