<!DOCTYPE html>
<html>
  <head>
    <link rel="icon" href="data:,">
    <style>
      body {
        width: 800px;
        margin: 0;
      }
      .box {
        width: 200px;
        height: 200px;
        float: left;
        margin: 100px;
      }
      #one {
        background: red;
      }
      #two {
        background: orange
      }
      #three {
        background: blue;
      }
      #four {
        background: green;
      }
    </style>
    <script type="text/javascript">
      window.onDblClick = function(id) {
        document.querySelector("#log").textContent = id;
      }
    </script>
  </head>
  <body>
    <div id="one" ondblclick="onDblClick('one')" class="box"></div>
    <div id="two" ondblclick="onDblClick('two')" class="box"></div>
    <div id="three" ondblclick="onDblClick('three')" class="box"></div>
    <div id="four" ondblclick="onDblClick('four')" class="box"></div>
    <div id="log"></div>
  </body>
</html>
