How do you find which link was clicked?
<p>How do I get a reference to the clicked link to delete the correct row?</p>

<pre><code>&lt;tr&gt;
&lt;td&gt;c1r1&lt;/td&gt;
&lt;td&gt;c2r1&lt;/td&gt;
&lt;td&gt;&lt;a href="javascript:delete_row();"&gt;delete&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;c1r2&lt;/td&gt;
&lt;td&gt;c2r2&lt;/td&gt;
&lt;td&gt;&lt;a href="javascript:delete_row();"&gt;delete&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;

function delete_row() {
    this.parent().parent().remove();
}
</code></pre>

<p>I know I can use (in jquery)</p>

<pre><code>$('a').click(function() {
    this.parent().parent().remove();
}
</code></pre>

<p>Or even this</p>

<pre><code>$('a').live('click', function() {
    this.parent().parent().remove();
});
</code></pre>

<p>To bind the function to dynamically created links.</p>

<p>But I'm looking for the way to get a reference to the clicked link without jquery. I'm using jquery <em>inside</em> the function, but that is not the point.</p>

<p><strong>Edit</strong>
Many are suggesting to use <code>this</code> in the function as parameter, I have tried that, but it returns <code>window</code>:</p>

<pre><code>&lt;a href="javascript:delete_row(this);"&gt;delete&lt;/a&gt;

function delete_row(elem) {
    console.log(elem);
}

Firebug console: Window config_maker.php
</code></pre>
