This article example describes how JS adds a confirmation dialog box to a hyperlink. Share it for your reference. The specific implementation method is as follows:
Copy the code as follows: <html>
<head>
<title>JS adds a confirmation dialog box to the hyperlink</title>
<script language="javascript">
<!--
function linkok(url){
question = confirm("Do you confirm that you want to link to "+url +"?");
if (question){
window.location.href = url;
}
}
//-->
</script>
</head>
<body>
Click this link to see the preview effect: → <a href="javascript:linkok('//www.VeVB.COM')">Wulin.com</a>
</body>
</html>
I hope this article will be helpful to everyone's JavaScript programming.