a.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language="JavaScript">
function func(){
//alert(document.getElementById("sel").options[0].value)
//alert(document.getElementById("sel").options[0].text)
//alert(document.getElementById("sel").options[0].outerHTML)
window.showModalDialog("./b.html",window,"dialogWidth=200px;dialogHeight=100px")
//var aaa=window.open("./b.html","window","width=100,height=100")
}var b="c";
var re = new RegExp( b, "gi" );
var str = "abcabc";
//alert(str.replace(re, "2"));
</script>
</HEAD>
<BODY>
<input type="text" name="text1">
<input type="button" name="btn1" value="1111" onclick="func()">
<script language="JavaScript">
//setTimeout("func()",1000)
</script></BODY>
</HTML>b.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language="JavaScript">
function funa(){
try{
if(document.getElementsByName("text2")[0].value==""){
    //alert("no thing")
}else{
var myfruit=dialogArguments;
myfruit.document.getElementsByName("text1")[0].value=document.getElementsByName("text2")[0].value;
self.close();
}
}catch(e){
}
}</script>
</HEAD><BODY>
<input type="text" name="text2">
<input type="button" name="btn1" value="1111" onclick="funa()">
</BODY>
</HTML>a.html,b.html放在一个文件夹下即可