Onclick确认不起作用 [英] Onclick Confirm Not working

查看:131
本文介绍了Onclick确认不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我有这行代码。

onClick="confirm('Are you sure you want to update the database
   to the latest version?')"><li class="navb">Update Version

但即使用户点击取消或没有,问题仍然存在。它仍然会执行该功能。非常感谢我在做错的任何帮助。谢谢

But the problem is even if the user clicks cancel or no. It will still perform the function. Would appreciate any help on what I'm doing wrong. Thanks

推荐答案

您必须使用 return confirm(...)代替只需确认(...)即可使用。

You must use return confirm(...) instead of just confirm(...) for it to work.

这篇关于Onclick确认不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆