본문 바로가기

개발하자/자바스크립트

window.open(새창띄우기)

a.html
======
<html>
<head>
<script>
window.onload=function(){
b.onclick=function(){
var n=window.open("b.html","nw","width=100px height=100px");
}
}
</script>
</head>
<body>
<input type="button" id="b">
</body>
</html>

b.html
======
<html>
<head>
<script>
window.onload=function(){

}
</script>
</head>
<body>
새창이다
</body>
</html>