Home > Web Front-end > JS Tutorial > body text

js popup confirmation cancel dialog box

高洛峰
Release: 2016-12-17 14:07:31
Original
1582 people have browsed it

一种:
<a href="javascript:if(confirm(&#39;确实要删除该内容吗?&#39;))location=&#39;http://www.google.com&#39;">弹出窗口</a>
二种:
<script language="JavaScript">             
function delete_confirm(e) 
{
    if (event.srcElement.outerText == "删除") 
    {
        event.returnValue = confirm("删除是不可恢复的,你确认要删除吗?");
    }
}
document.onclick = delete_confirm;
</script>
<a href="Delete.aspx" onClick="delete_confirm">删除</a>
三种:
if(window.confirm(&#39;你确定要取消交易吗?&#39;)){
                 //alert("确定");
                 return true;
              }else{
                 //alert("取消");
                 return false;
             }
 
四种:
 <script language="JavaScript">             
function delete_confirm() <!--调用方法-->
{
    event.returnValue = confirm("删除是不可恢复的,你确认要删除吗?");
}
</script>
Copy after login



For more js pop-up confirmation and cancel dialog boxes, please pay attention to the PHP Chinese website for related articles!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!