<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
function openWin() {
window.open('Ex03_popup.html','popup','width=450 height=700')
}
</script>
</head>
<body>
<form name='myform'>
<input type='text' name='id' value='ID'><br>
<input type='text' name='password' value='Password'><br>
<input type='button' value='팝업창열기' onClick="openWin()">
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Ex03_popup.html</title>
<script type="text/javascript">
function receiver(){
window.myform.id.value=window.opener.myform.id.value;
window.myform.password.value=window.opener.myform.password.value;
}
function closeButton(){
opener.myform.id.value=myform.id.value;
opener.myform.password.value=myform.password.value;
self.close();
}
</script>
</head>
<body onLoad="receiver()">
<img src='../images/pop1.jpg'> <br>
<form name='myform'>
<input type='text' name='id' value='아이디'><br>
<input type='text' name='password'><br>
<input type='button' value='닫기' onClick='closeButton()'>
</form>
</body>
</html>
Insert title here
Ex03_popup.html