title: How to get caller element using JavaScript?
body: <p>I have a table with id &quot;tbl&quot; and it has 2 rows and 3 cols. Each cell (td) has an explicitly defined id. Also, the table has an <code>onclick</code> event that calls a function <code>foo()</code>. The <code>onclick()</code> would be generated whenever any cell is clicked.
  The table tag is:</p>
  <pre><code>&lt; table id=&quot;tbl&quot; width=&quot;80%&quot; height=&quot;20%&quot; onclick=&quot;javascript: foo()&quot; &gt;
  </code></pre>
  <p>I also tried <code>javascript:foo(this)</code></p>
  <p>I want to find out the id of the table cell that was clicked.</p>
  <p>I have tried the following JavaScript:</p>
  <pre><code>function foo(e)
  {
      var sender = (e && e.target) || (window.event && window.event.srcElement);
      alert("Sender" + sender.id);
  }
  </code></pre>
  <p>This works great in Google Chrome and IE, but not in Firefox. In Firefox, sender is undefined.
  How to get the caller cell in Firefox?</p>