How to open link in new window/tab html/Javascript ?

links and map

To open link in new tab just use ‘target=”_blank” ‘. in anchor tag… like this

<a href="www.nstplanet.com" target="_blank">nstplanet.com</a>.
 
Sometime we want to open link in window… so here the script..You can change the width and height as per your need..

<a onclick="window.open('http://nstplanet.com', '_blank', 'location=yes,height=500,width=600,scrollbars=yes,status=yes');">Nurpur</a>

 

If you want to open MAP in new window so here is..
 

<a onclick="window.open('https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d13489.72892895275!2d75.87734607663494!3d32.300239597895036!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x391c82b83d3e067f%3A0x3f499a1cef47976b!2sNurpur%2C+Himachal+Pradesh!5e0!3m2!1sen!2sin!4v1522411790156', '_blank', 'location=yes,height=450,width=700,scrollbars=yes,status=yes');">Nurpur</a>

 

CLICK ON ME FOR DEMO..

 
 

If this help you then.. Can you buy a Cup of Coffee for me by nst webcreation paypal--OR-- nst webcreation blog coffee cup

Published by

NST

Myself Narender Singh Thakur ( NST ) and i share my Experience/Knowledge and Tricks for folks and beginners to solve their issues while making websites through this Planet.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Click to Chat