代码编辑器:
x
1
<script>
2
function openWin(){
3
myWindow=window.open('','','width=200,height=100');
4
myWindow.document.write("<p>这是我的窗口</p>");
5
}
6
function moveWin(){
7
myWindow.moveTo(0,0);
8
myWindow.focus();
9
}
10
</script>
11
<input type="button" value="打开窗口" onclick="openWin()" />
12
<br><br>
13
<input type="button" value="移动窗口" onclick="moveWin()" />
14