首页 > 其他 > 详细

alert的确定和取消

时间:2016-10-16 12:02:33      阅读:272      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <script type="text/javascript">
            function a(){
                var b=confirm("是否确定")//按确认和取消输出不同的内容
                if(b==true){
                    document.write("you pressed ok!")
//                f();
                }else{
//                    document.write("you pressed cancel!")
                }
            }
            function b(){
//                var c=prompt(‘请输入‘);
                var c=prompt(‘请输入‘,‘ss‘);
                alert(c);
//                alert(parseInt(c));
//                alert(typeof(c));
//                document.write(c);
            }
            function f(){
                alert(1111);
            }
</script>
        <input type="button" onclick="a()" value="aaaa"/>
        <input type="button" onclick="b()" value="bbbb"/>
    </body>
</html>

 

alert的确定和取消

原文:http://www.cnblogs.com/huangyongyong/p/5966142.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!