I have the following HTML:
<div class="control-group">
<input value="" id="email" name="email" type="text" placeholder="E-mail"/> <span class="help-inline"></span>
</div>
And the follow jQuery:
var input = $(this);
$.getJSON("/email", { email: data }, function(json){
if(json.valid == true){
input.parent().addClass("success");
}
});
How can I add the class 'success' to the div control-group? Also, how can I add content to the help-inline span?
Thanks.