child.html - > parent.html 我希望得到父值的值子值 但发生了跨性别问题 请帮帮我......
我在localhtml中测试
Parent.html
var openWin;
function openChild()
{
// window.name = "Parent Name";
window.name = "parentForm";
// window.open("open할 window", "ChildValue", "팝업창 옵션");
openWin = window.open("Child.html",
"childForm", "width=570, height=350, resizable = no, scrollbars = no");
}
<b><font size="5" color="gray">Parent</font></b>
<br><br>
<input type="button" value="openChild" onclick="openChild()"><br>
전달할 값 : <input type="text" id="pInput">
Child.html
function setParentText(){
opener.document.getElementById("pInput").value = document.getElementById("cInput").value
}
<font size="5" color="gray">childWindow</font></b>
<input type="text" id="cInput"> <input type="button" value="submit" onclick="setParentText()">
<input type="button" value="closeWindow" onclick="window.close()">