Figure out which row in an HTML table was clicked
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1824206/how-to-detect-which-row-tr-is-clicked">How to detect which row [ tr ] is clicked?</a>  </p>
</blockquote>



<p>I have a table like this:</p>

<pre><code>&lt;table&gt;
   &lt;tr&gt;
      &lt;td&gt;1&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
      &lt;td&gt;2&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
      &lt;td&gt;3&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;
   &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>In JavaScript (no jQuery please) how do I work out if a user clicks on the table on which row he/she clicked?</p>
