I do something like this:
$(".field-validation-error").addClass('ui-state-error');
and at some moment something like this happens
$("body").prepend("<span class="field-validation-error">This field is required.</span>")
I would like this new added element to have also the class 'ui-state-error'