Search code examples
javascripthtmlhyperlinkwindow

How to open a url in a new window?


I want to know how to open a url in a new window? I have seen a web site, when I click a link, a new window appears. Not a new tab, but a new window, and the new window is smaller than I already have. I'm guessing there's also some way to control the height and width of the window? How to do that? How to write the code?


Solution

  • Just do window.open("https://stackoverflow.com/questions/20507661/how-to-open-a-url-in-a-new-window","this is a new window"), but please don't add that to this page, or you might get a Stack Overflow