javascript onclick event binding
<p>I have my script here,</p>

<pre><code> &lt;script type='javascript'&gt;
 $(LastRow).find('#delete').attr('onclick','Comment_Delete(event,'+cID+')')
&lt;/script&gt;

&lt;input type="image" id="delete" border="0" src="../Resource/images/commentcross.jpg";" style="border-width:0px;"&gt;
</code></pre>

<p>i want control to be rendered as,</p>

<pre><code>&lt;input type="image" id="delete" border="0" onclick="Comment_Delete(event,1048);"  src="../Resource/images/commentcross.jpg";" style="border-width:0px;"&gt;
</code></pre>

<p>i.e. i want to bind <code>onclick</code> event to my <code>id=delete</code> tag.i have used my live as,</p>

<pre><code>$(LastRow).find('#delete').live('click','Comment_Delete(event,'+cID+')')
</code></pre>

<p>but gettintg error in chrome as <code>TypeError: Cannot call method 'replace' of undefined</code></p>
