How to open a new Window in JavaScript?

Posted by Poster under JavaScript category on | Views : 2804
Use following function

// open new window with specified path
function OpenWindow(url)
newwindow =, 'mywindow', 'width=500,height=400');

where parameters are like this

1st parameter: is the actual url to open like ""
2nd parameter is the name of the new window, you can refer in your code
3rd parameter is the property of the window you can specify (for all property details, see

You can use above function like this
For Link <a href="javascript:OpenWindow('')">Open DotNetFunda.Com</a>
For Button <input type="button" value="Open New Window" onClick="OpenWindow('')" />

Comments or Responses

Login to post response