Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在用户取消删除确认后,我想在元素上触发对 stopPropagation 的 javascript 调用。我不能在点击时执行此操作,因为它会阻止显示 JS 确认对话框。有没有办法将操作绑定到用户取消时?
if(confirm("Are you sure you want to delete")){ // user has chosen 'Ok' } else { // user has canceled // do your stuff }