I have a textbox on focus out, I am checking is if mail_id is already registered or not if not registered then I want to show the right symbol(correct font awesome symbol) in the text box(right side) and if not then I want to show the cross symbol.
I tried following
Html
<div class="col-md-6 col-lg-6">
<input type="text" name="user.mailId" id="mailid" placeholder="Mail Id" class="form-control rgn"/>
</div>
Jquery
$(document).on('focusout', '#mailid', function (event) {
$('#mailid').addClass('availablle');
});
CSS
.availablle {
position:relative;
}
.available:before {
content: "";
font-family: FontAwesome;
left:-5px;
position:absolute;
top:0;
color:green;
}