单击链接时显示带有 JavaScript 的确认弹出窗口 [英] Display confirmation popup with JavaScript upon clicking on a link

查看:27
本文介绍了单击链接时显示带有 JavaScript 的确认弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

How do I make one of those hyperlinks where when you click it, it will display a popup asking "are you sure?"

<INPUT TYPE="Button" NAME="confirm" VALUE="???" onClick="message()">

I already have a message() function working. I just need to know what the input type for a hyperlink would be.

解决方案

<a href="http://somewhere_else" onclick="return confirm()">

When the user clicks the link, the confirm function will be called. If the confirm function returns false, the link traversal is cancelled, if true is returned, the link is traversed.

这篇关于单击链接时显示带有 JavaScript 的确认弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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