<
html
>
< head >
< title > study 032 </ title >
< script language ="javascript" type ="text/javascript" > ...
function display()
...{
DispWin = window.open('', '新窗体', 'toolbar=no,status=no,width=300,height=200');
DispWin.document.write
(
"<ul><li><b>姓名:</b>" + document.form1.yourname.value + " " +
"<li><b>地址:</b>" + document.form1.address.value + " " +
"<li><b>电话:</b>" + document.form1.phone.value + "</ul> " +
"<p><button onClick='window.close();'>关闭</button></p>"
);
}
</ script >
< body >
< h1 > 显示表单数据 </ h2 >
< form name ="form1" >
< p >< b > 姓名: </ b >< input type ="text" size ="20" name ="yourname" ></ p >
< p >< b > 地址: </ b >< input type ="text" size ="20" name ="address" ></ p >
< p >< b > 电话: </ b >< input type ="text" size ="20" name ="phone" ></ p >
< p >< input type ="button" value ="显示" onClick ="display();" ></ p >
</ form >
</ body >
</ html >
< head >
< title > study 032 </ title >
< script language ="javascript" type ="text/javascript" > ...
function display()
...{
DispWin = window.open('', '新窗体', 'toolbar=no,status=no,width=300,height=200');
DispWin.document.write
(
"<ul><li><b>姓名:</b>" + document.form1.yourname.value + " " +
"<li><b>地址:</b>" + document.form1.address.value + " " +
"<li><b>电话:</b>" + document.form1.phone.value + "</ul> " +
"<p><button onClick='window.close();'>关闭</button></p>"
);
}
</ script >
< body >
< h1 > 显示表单数据 </ h2 >
< form name ="form1" >
< p >< b > 姓名: </ b >< input type ="text" size ="20" name ="yourname" ></ p >
< p >< b > 地址: </ b >< input type ="text" size ="20" name ="address" ></ p >
< p >< b > 电话: </ b >< input type ="text" size ="20" name ="phone" ></ p >
< p >< input type ="button" value ="显示" onClick ="display();" ></ p >
</ form >
</ body >
</ html >