请老师检查代码
来源:1-14 编程练习
pine小松
2020-06-04 16:19:58
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>打开/关闭页面</title>
</head>
<body>
<input type="button" value="关闭本页面" id="close">
<input type="button" value="打开慕课网" id="open">
<script type="text/javascript">
var close1=document.getElementById("close"),
open1=document.getElementById("open");
close1.onclick=function(){
window.close();
}
open1.onclick=function(){
window.open("http://www.imooc.com");
}
</script>
</body>
</html>
1回答
同学你好,代码是正确的。继续加油,祝学习愉快~