How to change (add) a DIV class on every input change?

unknown

New Member
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:\[code\]<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>\[/code\]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 \[code\]success\[/code\] after \[code\]control-group\[/code\] class or \[code\]error\[/code\] when input was leave empty. How I do this using jQuery?
 
Top