Put link (anchor) in select2 "no results" dropdown message

30 views Asked by At

When using select2, is there any way I can put a link in the "No results found" message? Meaning, the message that shows up when someone types in the select2, but there's no matching item. It seems to escape all text, so it doesn't seem like it is possible.

Here's what it looks like when a search term is typed in that's not in the list: enter image description here

Below, I have tried to change the noResults config, but it does not show a link, instead showing the escaped HTML

var config = {
        "language": {
                "noResults": function(){
                        return "If you see no results, please <a href='/disclaimer'>see disclaimer</a>"
                }
         ...
        },
   }

jQuery(selector).select2(config);
0

There are 0 answers