I have a question similar to this one, however there is one important difference. The method provided in the accepted answer works properly with "directly" bound events. It does not produce results if the handlers are assigned with the delegate
method. For example:
$("#some-element").delegate(".some-class", "click", function () {
alert("Click!");
});
After elements with class some-class
are generated and inserted into the html, is there a way to test if the click
event handler has been bound to them?
EDIT: As per @Pointy's comment I'll correct the question above, since the handler wouldn't be bound to .some-class
:
Is there a way to check if an element, represented, for instance, by a jQuery object (in this example it could be $(".some-class")
), if clicked, would trigger the handler?