本文介绍了点击链接后显示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()">
我已经有了一个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()">
当用户点击链接时,确认
函数将被调用。如果confirm函数返回 false
,则链接遍历被取消,如果返回true,则链接被遍历。
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确认弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!