BhaskerYadav BhaskerYadav - 1 year ago 79
Javascript Question

Event listener when tag is removed from auto complete jquery

I am using auto complete component of jquery. I have a select listener when a data is selected ,

$( ".aops-autocomplete" ).on('autocompleteselect', function (e, ui) {

As we can see on select of an element I am adding that to an array.

Now, I want to remove this when user deletes a tag from auto complete.
I don't know what listener should I use for this event.

I have tried remove, removeData but had no luck.

Answer Source

I found a solution by myself,

$(document).on("click", ".ui-icon", function(){
    var removedTag=$(this).parent().text();
    alert("Tag removed : "+removedTag);

I used delegated listener on its child component.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download