<html> <script language = "javascript"> var childs = new Array(); function openWin1(){ var s1 = window.open('son1.html','newwindow1', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no'); childs = childs.concat(s1);
} function openWin2(){ var s2 = window.open('son2.html','newwindow2', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no'); childs = childs.concat(s2); } function closeAll(){ for(var i=0,j=childs.length;i<j;i++){ if(childs[i] != null && !childs[i].closed) childs[i].close(); } } </script> <input type = "button" value="open1" onclick="openWin1()"> <input type = "button" value="open2" onclick="openWin2()"> <input type = "button" value="close" onclick="closeAll()"> </html>
<html>
<script language = "javascript">
var childs = new Array();
function openWin1(){
var s1 = window.open('son1.html','newwindow1', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no');
childs = childs.concat(s1);
}
function openWin2(){
var s2 = window.open('son2.html','newwindow2', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no');
childs = childs.concat(s2);
}
function closeAll(){
for(var i=0,j=childs.length;i<j;i++){
if(childs[i] != null && !childs[i].closed) childs[i].close();
}
}
</script>
<input type = "button" value="open1" onclick="openWin1()">
<input type = "button" value="open2" onclick="openWin2()">
<input type = "button" value="close" onclick="closeAll()">
</html>