您的位置:首页 > 其它

解绑单击对象的单击事件 不能再次单击

2016-05-17 15:21 302 查看
<script>
$(document).ready(function() {
$(".guess_box").click( function() {
$(".guess_box p").remove();
var discount = Math.floor((Math.random()*5) + 5);
var discount_msg = "<p>Your Discount is "+discount+"%</p>";
$(this).append(discount_msg);
$(this).unbind("click");//关键  事件 是对象
});
});
</script>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: