this is the main html page
<HTML>
<HEAD>
<TITLE>Main Window</TITLE>
</HEAD>
<script language="javascript">
var newwindow;
function Click(url)
{
newwin=window.open(url,"name1",'scrollbars=yes,HEIGHT=300,WIDTH=400,resizable=no,status=yes');
}
</script>
<BODY>
<form name="mainform">
<input type="Text" id="txtmain" value="Main Html">
<input type="Button" onClick="javascript:Click('sub.html');" value="Click Me">
</form>
</BODY>
</HTML>
this is the sub page
<HTML>
<HEAD>
<TITLE>sub Window</TITLE>
</HEAD>
<script language="javascript">
function Click()
{
self.opener.document.mainform.txtmain.value="Subhtml";
window.close();
}
</script>
<BODY>
<form>
<input type="Button" onClick="javascript:Click();" value="Sub Click Me">
</form>
</BODY>
</HTML>
make a two html pages on desktop one as main.html and one as sub.html copy first code in main and next one in sub. run the main.html