JavaScript > Methods

Opening popup window in JavaScript

How to open a popup window using JavaScrip?

In case we want to open a popup window from JavaScript, we can follow this approach.

        function TestFunction() {
  "", "", "width=200,height=300");

    <input type="button" id="btnTest" onclick="TestFunction()" value="Click me" />

In the click of the above button, a new popup window opens with DotNetFunda.Com website.

  • The 1st parameter of Open method is url to open
  • The 2nd parameter is the name of the window that is being opened (can be used from javascript to identify this window)
  • The 3rd parameter is features that are to be used to open the window (eg. width, height, menubar, resizeable etc.)
 Views: 3940 | Post Order: 53

Write for us

Hosting Recommendations