< html > < head > < title > study 025 </ title > < script language ="javascript" type ="text/javascript" > ... function DoIt()...{ if (document.form1.w.value && document.form1.h.value) self.resizeTo(document.form1.w.value, document.form1.h.value); if (document.form1.x.value && document.form1.y.value) self.moveTo(document.form1.x.value, document.form1.y.value);} </ script > </ head > < body > < form name ="form1" > < b > 宽度: </ b >< input type ="text" name ="w" >< br > < b > 高度: </ b >< input type ="text" name ="h" >< br > < b > 左边距: </ b >< input type ="text" name ="x" >< br > < b > 上边距: </ b >< input type ="text" name ="y" >< br > < input type ="button" value ="改变窗体位置和大小" onClick ="DoIt();" > </ form > </ body > </ html >