Traversing table and returning clicked element's placement
<p>I have an <code>onclick</code> function attached to each <code>&lt;td&gt;</code> element. The function needs to know the placement in the table (row and column).</p>

<p>I found an attribute called <code>rowIndex</code> for <code>&lt;tr&gt;</code>s, but that would involve getting the parent element and still doesn't help with column number.</p>

<p>Here is my function so far (it's within a loop, so it's attaching to every td)</p>

<pre><code>td.onclick = function(event) {
  event = (event) ? event : window.event;
  console.log('rowIndex, colIndex');
}
</code></pre>

<p>I could figure this out with jQuery, but I'm trying to do without.</p>
