<html>
<body>
<p>This example uses the addEventListener() method to attach a click event to the document.</p>
<p>Click anywhere in the document.</p>
<p><strong>Note:</strong> The addEventListener() method is not supported in Internet Explorer 8 and earlier versions.</p>
<p id="demo"></p>
<script>
document.addEventListener("click", function(){
document.getElementById("demo").innerHTML = "Hello World!";
});
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_document_addeventlistener by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:01:39 GMT -->
</html>