I want to change the placeholder attribute trying to attr()use it like this:
$(this).attr("placeholder", " Mandatory field");
But the result is not a Font-Awesome icon, it literally looks like this:
" Mandatory field"
However, 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;
}
This works, but I need to know how to get these results dynamically using jQuery.
Thanks in advance.
source
share