I want to know if there is a way to find from where a event was triggered, i have a form which makes use of multiple JavaScript libraries and in particular case a submit is triggered which is not desired. i want to find the origin of that event. Is there a way to add a listener which records the origin of the event when a specific type of event is triggered.
Something like this or may be something else:
el.addEventListener('click', e => {
console.log(e.getOrigin)
});
Edit:
just To make it clear, i know what e.target is, and no this is not what i am looking for
e.target gives the element on which that event was triggered, what i am looking for is - if the event was triggered from a function i want to know which function triggered it.