I try to find a way to check if an eventListener
already exists in a window, I've tried the solution in this similar question and more other solutions, but nothing works for me.
Here is the code:
checkEvent=function()
{
if('keydown' in window)
console.log('exist');
else
console.log('not_exist');
}
And here is my eventListener that I add on my page Load
document.addEventListener("keydown", PayKeydownHandler);
But the first code, returns 'not_exist'
as a result
PS: The function checkEvent()
, i call it in onclick of ENTER keydown.
Any help please? Thank's in advance.