<!DOCTYPE html>
<html>
  <head>
    <link rel="icon" href="data:,">
    <style>
      body {
        width: 800px;
        margin: 0;
      }
      #box {
        width: 800px;
        height: 600px;
        background: red;
      }
    </style>
    <script type="text/javascript">
      window.onload = function() {
        var log = document.querySelector("#log")
        var boxes = document.querySelector("#box")
        boxes.onclick = function(event) {
          var text = "x: " + event.pageX + ", y: " + event.pageY;
          log.textContent = text
        }
      }
    </script>
  </head>
  <body>
    <div id="box"></div>
    <div id="log"></div>
  </body>
</html>
