親ウィンドウからhtmlのポップアップウィンドウにデータを渡そうとしています。
以下は私のコードです-
<html>
<head>
<script type="text/javascript">
function init()
{
popupWin = window.open('','popupWin','');
popupWin.document.writeln('<html><head><title>test</title></head><body><form><input type="text" id="popupTextBox"/></form></body></html>');
popupWin.document.close();
popupText = popupWin.document.getElementById("popupTextBox");
parentText = document.getElementById("parentTextBox");
}
function transferText()
{
popupText.value = parentText.value
}
</script>
</head>
<body>
<input type="text" id="parentTextBox"/>
<input type="button" onclick="init();"/>
</body>
</html>
しかし、どういうわけか、上記のコードでそのテキストボックスのデータをポップアップウィンドウに渡すことができません。これに問題はありますか?
一般に、親ウィンドウからポップアップ ウィンドウにデータを渡そうとしています。