There's "new windows" and there's "popups". Using target=_blank will open in a new window, except that modern browsers put new windows in new tabs by default. Which sounds like it isn't what you want.

For an actual popup you want window.open(), and be sure to include some specific width and height, otherwise some browsers will still put the new window in a new tab. Darin's example looks good to me.

As for popup blocking, the general approach that browsers take is that popups initiated by user action are allowed (such as clicking), while popups initiated spontaneously through script, such as this, are blocked:

<script type="text/javascript">
    window.open("http://www.google.com/", "Google", "width=500,height=500");
</script>

However, ad blocking being an escalating war, you can never be sure that a popup will open. If your popup is blocked, the window.open call returns null. So I would modify Daren's example like this:

<a href="http://www.google.com/"
    onclick="return !window.open(this.href, 'Google', 'width=500,height=500')"
    target="_blank">

If the popup is blocked, onclick returns true, which follows the link they clicked by opening it in a new window or tab. It's a fallback, so at least the content is accessible (if not pretty).

Answer from jpsimons on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › Window › open
Window: open() method - Web APIs | MDN
null is returned if the browser fails to open the new browsing context, for example because it was blocked by a browser popup blocker. The Window interface's open() method takes a URL as a parameter, and loads the resource it identifies into a new or existing tab or window.
🌐
JavaScript.info
javascript.info › tutorial › frames and windows
Popups and window methods
An URL to load into the new window. ... A name of the new window. Each window has a window.name, and here we can specify which window to use for the popup. If there’s already a window with such name – the given URL opens in it, otherwise a new window is opened.
🌐
Super Dev Resources
superdevresources.com › home › blog › development › how to open links in a popup window
How to Open Links in a Popup Window - Super Dev Resources
June 18, 2020 - In order to open them in a new window, we add target="_blank" attribute to links. However to open the links in a separate popup window, we can make use of the onclick property and specifying a inline JavaScript code window.open as shown below.
🌐
Your HTML Source
yourhtmlsource.com › html source › javascript › popup windows | open new customised windows with javascript
Popup Windows | open new customised windows with JavaScript
November 17, 2025 - To get a rudimentary page to pop ... and JavaScript link: var newwindow; function poptastic(url) { newwindow=window.open(url,'name','height=400,width=200'); if (window.focus) {newwindow.focus()} }...
Find elsewhere
🌐
QuirksMode
quirksmode.org › js › popup.html
JavaScript - Popups
To create a popup you'll need the following script: <script language="javascript" type="text/javascript"> <!-- function popitup(url) { newwindow=window.open(url,'name','height=200,width=150'); if (window.focus) {newwindow.focus()} return false; } // --> </script>
🌐
SitePoint
sitepoint.com › javascript
Self close a Pop-Up -> then opening link in a new browser window? - JavaScript - SitePoint Forums | Web Development & Design Community
February 14, 2007 - Hi folks, I have a couple of Pop-Ups which contain links. These links should self close the Pop-Up, and then open up a new browser window to follow the link. I’m using the following function - but where do I specify that a new browser window should be used when someone clicks on the link (basically like a target: blank)? function goAndClose(url) { opener.location.href = url this.close; } and the link in the Pop-Up is marked like this:
🌐
Quackit
quackit.com › javascript › popup_windows.cfm
JavaScript Popup Windows
You can put the above code into a function, then call the function, passing the URL as a parameter, whenever you want to open a popup window. Doing this allows you to cut down on the amount of code you use when using popups. Here's a working example. ... The above script creates a function that accepts a parameter called "url". You can now call the function in your HTML as follows. ... Here, we create a normal HTML link, but we also add the onclick event handler to trigger our JavaScript function.
🌐
HTML.com
html.com › javascript › popup-windows
Popup Windows Made Easy: Here's The JavaScript Code To Copy And Paste »
March 19, 2020 - Lines 5 and 6 figure out what that URL is. In 5 we test if mylink is a string. If it is a string, we assign to href the value of the string. If mylink is not a string then we assume it is an <A> or <AREA> object and in line 6 assign to href the value of the objects href property (which was set in the HREF attribute of the <A> or <AREA> tag). Line 7 is the real kernel of the whole function — this is where the popup is actually opened. window.open() takes three arguments.
🌐
Javascript-coder
javascript-coder.com › window-popup › javascript-window-open
Using the window.open method | JavaScript Coder
<html> <head> <title>JavaScript Popup Example 3</title> </head> <script type="text/javascript"> function poponload() { testwindow = window.open("", "mywindow", "location=1,status=1,scrollbars=1,width=100,height=100"); testwindow.moveTo(0, 0); } </script> <body onload="javascript: poponload()"> <h1>JavaScript Popup Example 3</h1> </body> </html> Notice that the URL is kept blank. This will open a blank window. You can see the code in work in this file: JavaScript Popup Example 3
🌐
Tek-Tips
tek-tips.com › home › forums › software › programmers › web development › javascript
open new popup window - Javascript
February 22, 2010 - instead of opening a page in the same browser window, I want to open the url (e.g. beh.html) in a popup window. How can I change my script that way? <script type="text/javascript"> function buildArray() { var a = buildArray.arguments; for ( var i=0; i<a.length; i++ ) { this = a; } this.length = a.length; } var urls1 = new buildArray("", "beh.html", "gen.html"); function go ( which, num, win ) { var n = which.selectedIndex; if ( n != 0 ) { var url = eval ( "urls" + num + "[n]" ) if ( win ) { openWindow ( url ); } else { location.href = url; } } } </script> <form name="form1"> <select name="menu1" onchange="go(this, 1, false)"> <option>OPEN <option>BEH <option>GEN </select> </form>
🌐
Laurentian
web.cs.laurentian.ca › rsgrewal › c2206 › javascript › examples › windows › windows.html
Opening a pop up window
Close pop up window and click the following link to open it again. ... This method uses a special form of link which just executes a javascript function. ... Other useful features are menubar="yes", resizable="yes", scrollbars="yes", toolbar="yes", and status="yes". Note that the javascript designers cannot spell: use resizable not resizeable. The default values are "no". Click the following link to see a popup window with these values turned on.
🌐
Stack Overflow
stackoverflow.com › questions › 55705667 › how-to-open-url-from-popup-in-the-parent-window
javascript - How to open url from popup, in the parent window - Stack Overflow
However in the Chrome DevTools JavaScript Console I don't see any message. Using window.location.href the page is still opened inside the popup