How to add FontAwesome before the placeholder text on Select2.
This is my Select2 option code:
var placeholder = "<i class='fa fa-search'></i> " + "Select a places";
$(".select2").select2({
placeholder: placeholder,
width: null
});
This is my HTML code:
<select class="form-control select2">
<option></option>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>
Thank you.
<i class='fa fa-search'></i> <select><option>test</option></select>
just like this – Objectivism