access $(this) with href="javascript:..." in JQuery
<p>I am using JQuery. I call a javascript function with next html:</p>

<pre><code>&lt;li&gt;&lt;span&gt;&lt;a href="javascript:uncheckEl('tagVO-$id')"&gt;$tagname&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
</code></pre>

<p>I would like to <strong>remove the <em>li</em></strong> element and i thought this would be easy with the <strong>$(this)</strong> object. This is my javascript function:</p>

<pre><code>function uncheckEl(id) {
    $("#"+id+"").attr("checked","");
    $("#"+id+"").parent("li").css("color","black");     
    $(this).parent("li").remove();  // This is not working
    retrieveItems();
}
</code></pre>

<p>But <strong>$(this)</strong> is undefined. Any ideas?</p>
