确认对话框 演示

<html>
	<head>
		<title>确认对话框 演示</title>
	</head>
	<style>
		div{font-size:30px;}
	</style>
	<script>
function testConfirm(){
	var confirmed = window.confirm("真的要删除对象吗?");
	if(confirmed){
		document.getElementById("msg").innerHTML = 
			"删除成功!";
	}
}
function testPrompt(){
	var msg = window.prompt("输入信息:");
	document.getElementById("msg").innerHTML = msg;
}
	</script>
	<body>
		确认对话框 演示:
		<input type="button" value="测试确认框" 
			onclick="testConfirm()">		
		<input type="button" value="测试输入框" 
			onclick="testPrompt()">
		<div id="msg"></div>
	</body>
</html>

  

 
原文地址:https://www.cnblogs.com/a757956132/p/4313514.html