JavaScript点击按钮显示确认对话框

时间:2014-07-01 13:37:35   收藏:0   阅读:273
//JavaScript点击按钮显示确认对话框
<html xmlns="http://www.w3.org/1999/xhtml">  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />  
<title>My First Script</title>  
<script type="text/javascript">  
function test() {  
    var result = confirm("Please make sure.");  
    if (result == true) {  
        alert("You choose YES! Great!");  
    } else {  
        alert("What a bitch you are !");  
    }  
}  
</script>  
</head>  
<body>  
    <input type="button" value="Click Me!" onClick="test();" />  
</body>  
</html>  

JavaScript点击按钮显示确认对话框,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!