JavaScript练习题目(4)弹出新窗口,并点击其上的按钮可以进行(50px,50px)的位移

<html>
	<head>
		<title>Web Title</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<script type="text/javascript" src="js/test.js"></script>
	</head>
	<body>
		<input type="button" value="Click" onclick="test();" />
	</body>
</html>


function test () {
	newWindow = window.open('', '', 'width=200, height=100');
	newWindow.document.write("<html><head></head><body>");
	newWindow.document.write("<input type='button' value='move' onclick='move();' />");
	newWindow.document.write("<script type='text/javascript' src='js/test.js'></script>");
	newWindow.document.write("</body></html>");
}
function move () {
	self.moveBy(50, 50);
	self.focus();
}


你可能感兴趣的:(JavaScript,function,input,button)