JS常用的几种消息框

版权声明:转载原创文章请以超链接形式请注明原文章出处,尊重作者,尊重原创!


恰饭广告




<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script type="text/javascript">
        function warn_info(){
            alert("提示消息框");
        }
        function sure_info(){
            if (confirm("确认删除吗?")){
                alert("删除成功");
            }
            else{
                alert("取消删除");
            }
        }
        function input_info(){
            var txt=prompt("请输入您的年龄");
           if(txt==""){
               alert("输入为空,重新输入");
           }
           else{
               alert("您的年龄为"+txt)
           }
        }
    </script>
</head>
<body>
    <input type="button" value="提示消息" onclick="warn_info()">
    <input type="button" value="确认消息" onclick="sure_info()">
    <input type="button" value="输入消息" onclick="input_info()">
</body>
</html>  

原文链接:https://www.idaobin.com/archives/198.html

让我恰个饭吧.ヘ( ̄ω ̄ヘ)

支付宝 ——————- 微信
图片加载中图片加载中



恰饭广告

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

22 ÷ 11 =