2022-06-23 |

确认框

确认框

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>滴答编程(dida100.com)</title>
</head>
<body>

<p>点击按钮,显示确认框。</p>
<button onclick="myFunction()">点我</button>
<p id="demo"></p>
<script>
function myFunction(){
	var x;
	var r=confirm("按下按钮!");
	if (r==true){
		x="你按下了\"确定\"按钮!";
	}
	else{
		x="你按下了\"取消\"按钮!";
	}
	document.getElementById("demo").innerHTML=x;
}
</script>

</body>
</html>

0

发表评论

    评价:
    验证码: 点击我更换图片
    最新评论