I am using select2 library for my search. is there any way to trigger an action after selecting a search result? e.g. open a popup, or a simple js alert.
There was made some changes to the select2 events names (I think on v. 4 and later) so the '-' is changed into this ':'. See the next examples:
$('#select').on("select2:select", function(e) { //Do stuff });
You can check all the events at the 'select2' plugin site: select2 Events