title: JavaScript onClick event - HTML table
body: <p>I'm learning JavaScript and recently I have been experimenting with Mouse events, trying to understand how they work.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Mouse Events Example&lt;/title&gt;
      &lt;script type="text/javascript"&gt;
          function handleEvent(oEvent) {
              var oTextbox = document.getElementById("txt1");
              oTextbox.value += "\n" + oEvent.type;
  
              if(oEvent.type=="click")
              {
              var iScreenX = oEvent.screenX;
              var iScreenY = oEvent.screenY;
              var b = "Clicked at "+iScreenX+" , "+iScreenY;
  
              alert(b);
              }
          }
          function handleEvent1(oEvent) {
              // alert("Left Window");
          }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;p&gt;Use your mouse to click and double click the red square&lt;/p&gt;
      &lt;div style="width: 100px; height: 100px; background-color: red"
          onmouseover="handleEvent(event)"
          onmouseout="handleEvent1(event)"
          onmousedown="handleEvent(event)"
          onmouseup="handleEvent(event)"
          onclick="handleEvent(event)"
          ondblclick="handleEvent(event)" id="div1"&gt;&lt;/div&gt;
      &lt;p&gt;&lt;textarea id="txt1" rows="15" cols="50"&gt;&lt;/textarea&gt;&lt;/p&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>this is the code I have been trying to understand. Can anyone help me to Create a HTML table that upon clicking in a cell of the table user is told cell he is clicking in?
  been stuck on it for time, thanks for help.</p>