title: How do i get the position of a child element
body: <p>i need to find the position of a child element.</p>
  
  <p>i have a table and when a td is clicked, i want the position of the td(0,1 or 2)</p>
  
  <pre><code>&lt;table&gt;
  &lt;tr&gt;
   &lt;td&gt;   
  
   &lt;/td&gt;
   &lt;td&gt;   
  
   &lt;/td&gt;
   &lt;td&gt;
  
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>and a script like this</p>
  
  <pre><code>&lt;script&gt;
  $("td").click(function(){
    //how do i get the position of the td?
    alert("column " + columnPosition + "is clicked")
  });
  &lt;/script&gt;
  </code></pre>