I need to do in pure JavaScript what I easily do in jQuery:
$('document').click(function(e){
e.preventDefault();
});
In some manner, jQuery guarantees that my event runs first, thus preventing every other registered click event will not be executed.
When I'm trying it with JavaScript
document.addEventListener('click', function(e){
e.preventDefault();
e.stopPropagation();
}, 1);
My event is always running last, so I can't prevent the others.
Is there anyway to guarantee that the event I'm added, will be added to the top of the stack, so is executed first?