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?
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.
Just change the button for <a href="#" id="myBtn">Open Modal</a> , your current script will assign the onclick method.
Example. <div class="popup" onclick="myFunction()">Click me!
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With