<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body {
font-family: "Microsoft YaHei", serif;
}
body, dl, dd, p, h1, h2, h3, h4, h5, h6 {
margin: 0;
}
ol, ul, li {
margin: 0;
padding: 0;
list-style: none;
}
img {
border: none
}
</style>
</head>
<body>
<input type="button" value="关闭" id="btn1">
<input type="button" value="打开" id="btn2">
<script>
// BOM Browser Object Model 浏览器对象模型
let oBtn1 = document.getElementById("btn1");
let oBtn2 = document.getElementById("btn2");
oBtn1.onclick = function () {
window.close()
};
oBtn2.onclick = function () {
window.open(
"https://www.baidu.com",
"_blank"
)
}
// setTimeout(function () {
// window.close()
// },2000)
</script>
</body>
</html>
Python3Turtle