Answers for "how to append select2 to existing dropdown"

0

select2 dropdown with option to add new item

$('#select2')
    .select2()
    .on('select2:open', () => {
        $(".select2-results:not(:has(a))").append('<a href="#" style="padding: 6px;height: 20px;display: inline-table;">Create new item</a>');
})
Posted by: Guest on October-31-2020

Code answers related to "how to append select2 to existing dropdown"

Browse Popular Code Answers by Language