Open a new window in JavaScript

Description

The following code shows how to open a new window.

Example


<!--  w  w  w  . j a v  a 2 s.  c  o m-->
<!DOCTYPE HTML>
<html>
<body>
<script type="text/javascript">
window.open("http://www.java2s.com/",
"java2sWindow",
"height=400,width=400,top=10,left=10,resizable=yes");

</script>
</body>
</html>

Click to view the demo

The code above generates the following result.

Open a new window in JavaScript