我有以下的html代码:如何替换的onclick函数调用我的函数调用
<td align="center" class="shuttleControl">
<img src="/i/mydb/icons/shuttle_reload.png" onclick="g_Shuttlep_v61.reset();" alt="Reset" title="Reset"/>
<img src="/i/mydb/icons/shuttle_last.png" onclick="g_Shuttlep_v61.move_all();" alt="Move All" title="Move All"/>
<img src="/i/mydb/icons/shuttle_right.png" onclick="g_Shuttlep_v61.move();" alt="Move" title="Move" />
<img src="/i/mydb/icons/shuttle_left.png" onclick="g_Shuttlep_v61.remove();" alt="Remove" title="Remove" />
<img src="/i/mydb/icons/shuttle_first.png" onclick="g_Shuttlep_v61.remove_all();" alt="Remove All" title="Remove All" />
基于上面的代码,使用jQuery,我怎么可以代替所有上述的onclick调用而是使用我的JavaScript函数get_Count();
所以结果我后:
<td align="center" class="shuttleControl">
<img src="/i/mydb/icons/shuttle_reload.png" onclick="get_Count();" alt="Reset" title="Reset"/>
<img src="/i/mydb/icons/shuttle_last.png" onclick=" get_Count();" alt="Move All" title="Move All"/>
<img src="/i/mydb/icons/shuttle_right.png" onclick=" get_Count();" alt="Move" title="Move" />
<img src="/i/mydb/icons/shuttle_left.png" onclick=" get_Count();" alt="Remove" title="Remove" />
<img src="/i/mydb/icons/shuttle_first.png" onclick=" get_Count();" alt="Remove All" title="Remove All" />
</td>
希望有人可以帮助。
谢谢。
@Spiny,我的代码中还有其他img标签,所以我怎样才能确保我只引用了ShuttleControl类? – tonyf 2010-12-21 23:12:27
`.unbind()`用于jQuery处理程序。 – user113716 2010-12-21 23:16:06