click anywhere on page javscript code example Example: function click anywhere javascript document.body.addEventListener('click', fn, true);