Returning false on an event handler, is equivalent to call both event.preventDefault and event.stopPropagation, your code should work, but what about:$('a.confirm').click(function() { return confirm('Are you sure? This cannot be undone.');});如果用户取消确认,它将返回false.It will return false if the user cancels the confirm...在此处运行该代码段. 这篇关于如何使用jQuery/JavaScript禁用点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-12 07:11