Welcome 微信登录

首页 / 脚本样式 / JavaScript / jQuery实现按钮只点击一次后就取消点击事件绑定的方法

本文实例讲述了jQuery实现按钮只点击一次后就取消点击事件绑定的方法。分享给大家供大家参考。具体实现方法如下:
<input type="button" id="my-selector" value="只能点击一次" /><script>$("#my-selector").bind("click", function() {$(this).unbind("click");alert("Clicked and unbound!");});</script>
希望本文所述对大家的jQuery程序设计有所帮助。