I'm asking if is possible to change (add) dinamically a class to a DIV on input change/validation. Less say for example I have two classes: success and error. The HTML markup is basically this one:
<div class="control-group"> <label class="control-label" for="inputFirstName">First Name: <span class="text-error">*</span></label> <div class="controls"> <input type="text" id="inputFirstName" placeholder="John"> </div> </div>
So when I fill the input with some value (no matter if is right or not because I handle validations trough PHP) then I should write success after control-group class or error when input was leave empty. How I do this using jQuery?