Home >Web Front-end >JS Tutorial >JS implements confirmation pop-up window when deleting

JS implements confirmation pop-up window when deleting

高洛峰
高洛峰Original
2016-12-17 14:05:422188browse

JS realizes the confirmation pop-up window when deleting

一种:
<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>



For more related articles about JS realizing the confirmation pop-up window when deleting, please pay attention to the PHP Chinese website!

Statement:
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