I tried to find the answer to my problem, but was not successful - apologies if the answer is very obvious :). Here is the premise of the problem I'm trying to solve.
- I have many interface elements (buttons, hyperlinks, etc.) to which native events are attached (for example, clicking on a link performs a function)
- I do not have access to these event listeners, and I do not know what functions / handlers should be called.
- I would like to make a general function that: o cross-section through the DOM, find user interface elements, such as a button or a hyperlink, and connect additional listeners to it that will perform the same handlers / functions (for example, I want to attach listeners " touchhend "which will perform the same handlers / functions as the" click "event)
Is there a way for me to somehow find out which event handlers are used (used) for a specific user interface element, and then add a new listener for the same handler using the .on () method?
IvanS source
share