Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140734

Click event works some times and doesn't work other times - Chrome extension

$
0
0

I'm writing an extension for Chrome that listen and capture the click events made by the user. This is the way I'm capturing the event

document.addEventListener('click', async function (e) {

});

It works good in many cases, but there're other cases where click event never get triggered, instead there're one or more focusout events that get triggered. I understad that focusout event may be shooted when javascript changes some like setting value to an hidden input or something like that.

The problem is that I cannot understand why in some cases click event is not triggered. I could think that in moment when the function (the function showed above) is attached to the content there're some elements that still aren't attached to the DOM, but I'm not sure and really have not find documentation about. or a way to test it. I'll be thankfull if somebody can give me a hand with this


Viewing all articles
Browse latest Browse all 140734

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>