forked from easysIT/doit_HTML-CSS-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclose.html
More file actions
36 lines (35 loc) · 772 Bytes
/
close.html
File metadata and controls
36 lines (35 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Window 객체</title>
<style>
#container{
width:300px;
margin:20px auto;
}
button {
border:1px solid #222;
padding:15px;
font-size:0.8em;
margin-right:20px;
}
</style>
</head>
<body>
<div id="container">
<button onclick="openWin()">팝업 창 열기</button>
<button onclick="closeWin()">팝업 창 닫기</button>
</div>
<script>
function openWin() {
let opt = 'width=400, height=350, left=300, top=200'
myWin = window.open("doit.html","doit", opt);
}
function closeWin(){
myWin.close();
}
</script>
</body>
</html>