我在PHP生成的html中有一些onclick和mouseover事件,如下所示:
<div onmouseover="fave('heart_<?php echo $row['id']; ?>';" class="heart"><a href=""></a></div>
Run Code Online (Sandbox Code Playgroud)
我希望在鼠标悬停时使用unbind但是当我尝试这个时它没有用:
$('#'+ id).unbind('mouseover');
Run Code Online (Sandbox Code Playgroud)
所以我猜unbind只适用于JQuery创建的事件?我还能尝试别的吗?
顺便说一句,我无法将我的事件移动到单独的js文件,因为每个id都是唯一的.
谢谢大家