Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make a hyperlink open as a popup with a given width and height?

I have a hyperlink that is:

 <a href="some.html">Test</a>

If I click on the Test link, some.html should open as pop up menu with some given width & height.

How can I do this?

like image 476
Bipin Avatar asked Nov 22 '10 07:11

Bipin


People also ask

How do I open a URL with a popup screen?

Open Link in a Popup Window 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.

How do I open a link in modal popup?

Just change the button for <a href="#" id="myBtn">Open Modal</a> , your current script will assign the onclick method.

How do I create a pop-up link in HTML?

Example. <div class="popup" onclick="myFunction()">Click me!


1 Answers

You can use window.open():

<a href="javascript:window.open('some.html', 'yourWindowName', 'width=200,height=150');">Test</a>

Or:

<a href="#" onclick="window.open('some.html', 'yourWindowName', 'width=200,height=150');">Test</a>
like image 129
Frédéric Hamidi Avatar answered Sep 22 '22 11:09

Frédéric Hamidi