Jquery change onclick function name
<p>My question is! I am copying content from one table to another table and when I am doing this I need the function name to change to talentselect instead of driverselect which is attached to each table row. I still need to keep the variable values to parse. Just wondering if anyone can help me with this. I know that I should be binding the events to the elements with Jquery and not using OnClick but for now I need a solution to achieve this with the OnClicks.</p>

<p>Many Thanks!</p>

<p>The copying of the table</p>

<pre><code>&lt;table id="driverselectiontable" cellspacing="0"&gt;
&lt;tr class="chosen" onclick="return driverselect(this, value, value);"&gt;
&lt;td&gt;driver&lt;/td&gt;&lt;/tr&gt;
&lt;tr class="odd" onclick="return driverselect(this, value, value);"&gt;
&lt;td&gt;driver&lt;/td&gt;&lt;/tr&gt;
&lt;tr class="even" onclick="return driverselect(this, value, value);"&gt;
&lt;td&gt;driver&lt;/td&gt;&lt;/tr&gt;
&lt;tr class="chosen" onclick="return driverselect(this, value, value);"&gt;
&lt;td&gt;driver&lt;/td&gt;&lt;/tr&gt;
&lt;tr class="even" onclick="return driverselect(this, value, value);"&gt;
&lt;td&gt;driver&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;table id="talentselectiontable" cellspacing="0"&gt;
&lt;/table&gt;


$("#talentselectiontable").html($("#driverselectiontable .chosen").clone(true).attr("class","odd"));
</code></pre>

<p>So basically I am copying all of the table rows that have the class named "chosen" but upon doing so I need to change the function call name to "talentselect". But each row in the table has different parameters being parsed which is allocated with PHP.</p>

<p>I have tried this piece of code but it is not working still</p>

<pre><code>$("#talentselectiontable tr").attr("onclick").replace("driverselect", "talentselect");
</code></pre>
