How to Open Link in New Tab on Click in javascript ?

Today now in this blog, I will show you how to open the link in new tab by using on click in javascript. IF you want to open url in the new tab then you can follow this example.

Here you will see the full example of onclick open link in the new tab in javascipt. So now here i am use to open the link in new tab by using javascript.

So Let’s start and see example and we can use anyone of this as you need.


<!DOCTYPE html>
    <title>javascript open link in new tab on click -</title>

    <button onclick="getLink();">Click me</button>

    <script type="text/javascript">
        function getLink() {

Read Also : Laravel 8 Mobile Number Verification Tutorial

Thank you read.Hope it will help you. Also follow onĀ facebook


About Shahriar Sagor

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by Shahriar Sagor →