87,904
社区成员
发帖
与我相关
我的任务
分享
function openWin()
{
window.open(window.location.href,"","width=200,height=200");
}
function setValue(obj)
{
window.opener.document.getElementById(obj).value=event.srcElement.value;
}
<input type="button" value="open new win" onclick="openWin()">
<input type="button" value="1" onclick="setValue('txt1')">
<input type="button" value="2" onclick="setValue('txt2')">
<input type="text" id="txt1">
<input type="text" id="txt2">