I use the jQuery based library Select2.
Within the library https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.js the following function is defined:
MultipleSelection.prototype.selectionContainer = function () {
var $container = $(
'<li class="select2-selection__choice">' +
'<button type="button" class="select2-selection__choice__remove" ' +
'tabindex="-1">' +
'<span aria-hidden="true">×</span>' +
'</button>' +
'<span class="select2-selection__choice__display"></span>' +
'</li>'
);
return $container;
};
How can I change/overwrite this function without changing the original file?