如何将值从父窗口字段传递到子窗口字段。
我使用window.open(“ www.google.com”);
弹出窗口打开后,我需要将在父窗口中键入的搜索值传递/设置为子窗口(www.google.com)
最佳答案
使用window.open()方法设置引用:
var childWin = window.open("www.google.com" <etc.>);
然后将childWin视为整个其他窗口。例如,
childWin.document.getElementById('searchField')
将为您提供ID为“ searchField”的元素的引用。等冲洗并重复。
关于javascript - 将值从“父级”传递给“子级(打开)”窗口,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2678133/