Figure out the element in the a table (using class) when using jquery
<p>I am using a table grid in my HTML and while clicking on a specific <code>col</code> in each row, I dynamically create an additional row using <code>&lt;tr&gt;</code>. The additional row is used to submit data to the server and remove it after submit. Now I would like in addition to this that the row number of the table will be sent to the server as well. </p>

<p>The table is changed dynamically as I am adding rows for editing. I thought about fixing this by giving each <code>&lt;tr&gt;</code> a class named <code>task_entry</code> and by counting the number of <code>.task_entry</code> elements I will be able to figure out which row I am in. However I cannot get this to work. I tried to use <code>$(".task_entry").index(this)</code> but it returns -1.</p>

<p>Can anyone help?</p>
