How to create popup window in JavaScript (Open another window)?

How to create popup window in JavaScript (Open another window)?, someone asked me to explain?

In this article, I will show you to open a popup window using JavaScript. You can customize the new window open features such as directories, width, height, location, resizable etc.

If you set the resizable option to turn off, you’re not able to maximize the window. When the user presses the button, JavaScript event is triggered and it will call the OpenWindow() function. The new window should be opened at the center of the screen.


<script type="text/javascript">
        function OpenWindow() {
            winObj ="", "google",
            winObj.moveTo(250, 250); // Move window to middle
            parent.window.moveTo(215, 0); // Move the parent window
            parent.window.resizeTo(400, 400); // Resize browser window
        function closeWindow() {
        <h2>open a popup window </h2>
    <br />
        click the button
     <input type="button" value="Open browser window" onclick="OpenWindow();" />
        <p>When you are ready to close the window, click here</p>
        <a href="#" onclick="closeWindow();">close the window</a>



javascript open browser window

Post your comments / questions