add button to select2 dropdown code example
Example: select2 dropdown with option to add new item
$('#select2')
.select2()
.on('select2:open', () => {
$(".select2-results:not(:has(a))").append('Create new item');
})
$('#select2')
.select2()
.on('select2:open', () => {
$(".select2-results:not(:has(a))").append('Create new item');
})