点击链接后显示JavaScript确认弹出窗口

编程入门 行业动态 更新时间:2024-10-27 22:32:01
本文介绍了点击链接后显示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="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确认弹出窗口

本文发布于:2023-08-06 02:15:06,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:弹出窗口   链接   JavaScript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!