I want to change the placeholder attribute trying attr() using it this way:
$(this).attr("placeholder", " Mandatory field");
But the result is not the Font-Awesome icon , it literally looks looks like this:
" Mandatory field"
Nevertheless, if I put
<input type="text" class="mandatory_field form-control" id="affiliation" placeholder=" Mandatory field"/>
with CSS
.mandatory_field {
font-family: FontAwesome,"Helvetica Neue",Helvetica,Arial,sans-serif;
}
It works, but I need to know how to get those results dynamically with jQuery.
Thanks in advance.