JS: Pop-up New Window

By Xah Lee. Date: . Last updated: .

This page shows a JavaScript example of popping up a window.

to popup a window.

HTML code:

<button id="id46415">Click Me</button>

JavaScript code:

function f1() {
    // window.open(URL, name, spec)
    let xWin = window.open( "ex/pop_me.html", "Alice", "width=400,height=300,left=100");
    xWin.focus();
}

document.getElementById("id46415").addEventListener("click", f1 , false);

JavaScript Fancy UI Examples

  1. JS: Image Rollover
  2. JS: Pop-up New Window
  3. JS: Digital Clock
  4. JS: Stopwatch
  5. JS: Fade a Element
  6. JS: Fade a Element Using CSS Transition
  7. JavaScript UI: Shake Element
  8. JS: How to Create Tooltip
  9. JS: Falling Snow Effect
  10. JavaScript Floating Box Following Scroll
Liket it? Put $5 at patreon.

Or, Buy JavaScript in Depth

Patreon me $5. Ask me question on patreon