The jQuery Validation plugin works great and is very easy to use:
$(\".selector\").validate({ })
Just by setting css classes like \"require
You can add class rules using the addClassRules method:
E.g.
$.validator.addClassRules("your-class", { required: true, minlength: 2 });
https://jqueryvalidation.org/jQuery.validator.addClassRules/