I\'m looking for a way to attach a click-event to a select2-result-item. I\'ve gone ahead and formatted both result and selection via
function format(state)
use default select2select event trigger instead of using other jquery events
$('#mySelect2').on('select2:select', function (e) { var data = e.params.data; console.log(data); });
for more details refer below link https://select2.org/programmatic-control/events