I want to add one icon to placeholder like this
$(\"#tag_list\").select2({
allowClear: true,
placeholder: \"
Select2 automatically escapes HTML markup.
$("#tag_list").select2({
allowClear: true,
placeholder: " inout your tags...",
tags: ['a', 'b', 'c'],
escapeMarkup : function(markup) { return markup; } // let our custom formatter work
});
By overriding the 'escapeMarkup' parameter you can force it to render plain HTML instead (by returning the unescaped HTML as is). This will affect both the placeholder AND the select data (select2 handles the placeholder as any data, thus escaping it).
For more information, check the AJAX data example: Examples - Select2 | LoadingRemoteData