Removing multiple namespaced event handlers
Hello all,
Please, I would like to know how efficient it is to do this:
suppose I have a div with id: "target", and I have a click handler attached to it like this:
- $('#target').on('click.uds', function(){ });
which of the following code will be more efficient in removing the event handler:
- $('*').off('.uds');
or
- $('#target').off('click.uds');
I initially thought the 1st was better since it does not have to search through the entire DOM. But then, I might be wrong