Question: Is there a possible way to fire an event when user clicks the no matches found message in jquery plugin select2??? i need that event for my project i have tried this code but it seems not working

```
$('.select2-no-results').live('click',function(){
alert("Yes");
});

$('.select2-drop-active').delegate('li.select2-no-results','click',function(){
alert('Hello');
});

```

is there a possible solution for this????

Answer: 
Hope my solution helps with your problem:

**\*Select2 configuration**

```
var $select2 = $('#select2_id').select2(
{
    //Your parameters
    formatNoMatches: Not_Found
});

```

**\*Error handling function**

```
function Not_Found()
{
    var $not_found = '<div>Result not found. <a href="#" onclick="return myClick()">click here to event</a></div>';
    return $not_found;
}

```

**\*myClick() function**

```
function myClick()
{
  alert('hello');
}

```

Note: In my code, this function needs to be at the top to avoid an error which I don't know why this happens.

Source: <https://github.com/ivaynberg/select2/issues/276>
try using .trigger()

```
   $(".select2-no-results").click(function()
                               {
                                  $("li.select2-no-results").trigger("click");
                               });

```