I am trying to handle a click event for an element created dynamically (so can't use .click jQuery call) but at the same time, I don't want the default action to take place. Basically I want to show my custom UI instead of the default one.
jQuery(document).on('click', selector, function(e) {
console.log('I got the event, let me try to stop other handlers ..');
// none of these work
e.preventDefault();
e.stopImmediatePropagation();
e.stopPropagation();
// want show my UI here ...
return false;
});
Also tried mousedown event.
But it doesn't work and the default UI still shows up.
Note: I dont control the default handler, can't change that.