How do I use jQuery validator to add/remove a classname (e.g. validate
) on the form element's parent <li>
so I can style everything related to that element by only setting the one classname?
The markup is
<li class="validate">
<label for="product">Product of interest <abbr title="Required field">*</abbr></label>
<input id="product" type="text" name="product" value="" placeholder="e.g. school bench" class="required" minlength="2">
<!-- Hidden by CSS unless parent has 'validate' class -->
<label for="product" class="description">Please name a product.</label>
</li>
and the default jQuery is
$("#commentForm").validate();