Browsed the web and stackoverflow without luck.
How to check if a particular event is applied on top of a specific element. Let's say I am doing like this:
function addEvent(elem, event, fn) {
if (elem.addEventListener) {
elem.addEventListener(event, fn, false);
} else {
elem.attachEvent("on" + event, function() {
return(fn.call(elem, window.event));
});
}
}
addEvent(document, 'scroll', onScroll);
function onScroll() {console.log("scroll"}
How I could check dynamically if my event is bound to the document? Thank you.