multi select dropdown search with dynamically add options code example
Example 1: multiple search selection dropdown
Example 2: select2 dropdown with option to add new item
$('#select2')
.select2()
.on('select2:open', () => {
$(".select2-results:not(:has(a))").append('Create new item');
})