Is anything wrong with this code?

Is anything wrong with this code?

Hi,

Is anything wrong with this code:?

  1.     $("input").each(function() {

  2.       if ($("input").hasClass("error")) {
  3.           $(this).parents().find(".text-input-large__wrapper").addClass("text-input-large__wrapper--error");
  4.       }

  5.     });

Thanks