<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<button id="butAlert">警告弹框</button>
<button id="butConfirm">确认弹框</button>
<button id="butPrompt">提示弹框</button>
<script>
var al= document.getElementById("butAlert");
var con= document.getElementById("butConfirm");
var pro= document.getElementById("butPrompt");
al.onclick = function(){
window.alert("这是警告弹窗!")
}
con.onclick = function(){
window.confirm("确认弹框!")
}
pro.onclick = function(){
window.prompt("提示弹框!")
}
</script>
</body>
</html>
BOM-弹框的使用
最新推荐文章于 2024-11-05 22:07:06 发布