62,242
社区成员




<!---main----->
<html>
<BODY>
<form name="form1">
<input type="button" value="click me and open a dialog window" onclick="ShowDialog()"/>
<input type="textbox" name="txt1" width="200"/>
</form>
</BODY>
</html>
<script language="JavaScript">
function ShowDialog()
{
document.form1.txt1.value=window.showModalDialog("Dialog.html");
}
</script>
<!----Dialog.html------->
<html>
<base target="_self">
<BODY>
<form name="form1">
<input type="textbox" name="txt1" width="200"/>
<input type="button" value="return" onclick="ReturnValue()"/>
<a href="http://www.google.cn">gooooogle</a>
</form>
</BODY>
</HTML>
<script>
function ReturnValue()
{
window.returnValue=document.form1.txt1.value;
window.close();
}
</script>