<script language="javascript">
function openWindow()
{
window.open('子視窗網址','mywindow','width=400,height=200');
}
</script>
<form name="form1">
<input type="text" name="textInput">
<input type="button" value="open windows" onClick="javascript:openWindow()">
</form>
子視窗
<script language="javascript">
function backToParent()
{
opener.document.form1.textInput.value = document.form2.input.value;
window.close();
}
</script>
<form name="form2">
<input type="text" name="input">
<input type="button" value="pass Value" onClick="javascript:backToParent()">
</form>
參考範例:點此