2
You can use the Select2 component to do this. Click here to open the link.
Example:
$(".js-example-basic-multiple").select2();
<select class="js-example-basic-multiple" multiple="multiple">
<option value="AL">Alabama</option>
...
<option value="WY">Wyoming</option>
</select>
Then you can customize the template
by placing below the ones selected as you are in the image you put as example.
Example modifying component template:
function formatState (state) {
if (!state.id) { return state.text; }
var $state = $(
'<span><img src="vendor/images/flags/' + state.element.value.toLowerCase() + '.png" class="img-flag" /> ' + state.text + '</span>'
);
return $state;
};
$(".js-example-templating").select2({
templateResult: formatState
});
I hope it helped you.
In another topic I had seen something similar, I will try and post the result. Thanks.
– Felipe