Pass 'this' from one function to another in javascript?
<pre><code>function removeNewsItem(id,idStamp,obj){
 $('#whiteCover')show();

 $('#contentOfBox').html= ('Are you sure you want ot completely remove this news item?&lt;br/&gt;&lt;br/&gt;&lt;div style="text-align:center;"&gt;&lt;input type="button" class="button blue medium" onclick="removeNewsItemConfirmed(\'' + id + '\',\''+idStamp+'\','+**obj**+')" value="Yes"/&gt; &lt;input type="button" class="button red medium" value="No" onclick="resetContentBox();"/&gt;&lt;/div&gt;');

 $("#whiteCoverContainer").fadeIn();
}

function removeNewsItemConfirmed(id,idStamp,obj){
   alert(obj);
   $(obj).remove();
   return;
}

&lt;tr&gt;&lt;td onclick=removeNewsItem('111','134234',this)&gt;&lt;/td&gt;&lt;/tr&gt;
</code></pre>

<p>When I click on the td with the removeNewsItem on it, i cannot seem to be able to pass the 'this' element on to the next function: After the user clicks, they are shown a message asking to confirm deletion, but when they click it the 'this' is not getting passed properl, or more to the point I can't fihure out how...</p>

<p>Could somebody please help: How can I pass obj onto another inline onclick event like above?</p>
