javascript:弹出窗体的知识点
1 <html> 2 <head> 3 <title>1</title> 4 <style type='text/css'> 5 #box{ 6 width:300px; 7 height:200px; 8 border:dashed 1px green; 9 } 10 </style> 11 </head> 12 <body> 13 <div id='box' onclick="fun();"> 14 </div> 15 <script language='javascript'> 16 function fun2(){ 17 if(confirm("确定删除该条记录?")){ 18 location.reload(); 19 }else{ 20 alert("保持不变"); 21 } 22 } 23 function fun(){ 24 if(prompt("请输入您喜欢的颜色")==null){ 25 alert('您没有填好颜色'); 26 } 27 } 28 29 </script> 30 31 </body> 32 </html>
1 <html> 2 <head> 3 <title>1</title> 4 <style type='text/css'> 5 #box{ 6 width:300px; 7 height:200px; 8 border:dashed 1px green; 9 } 10 </style> 11 </head> 12 <body> 13 <div id='box' onclick='fun();'> 14 </div> 15 <script language='javascript'> 16 function fun(){ 17 var hand=window.open('http://www.baidu.com',"search","width=700,height=500,top=100,left=300,toolbar=no,menubar=no,location=yes,status=yes,resizable=yes"); 18 setTimeout(function(){hand.close();},'3000'); 19 20 } 21 </script> 22 23 </body> 24 </html>