How to Open Webpage Links in a New Tab in jquery?

Today, We want to share with you jquery open link in new tab.In this post we will show you how to open a referenced resource of a link in a new tab in jQuery Example., hear for first of all Opening of a URL in a new tab or window depends on the browser and the user’s browser preferences. we will give you demo and example for implement.In this post, we will learn about jquery – Simple open url in new window jquery with an example.

How to open a URL in a new tab (and not a new window) using jQuery?

There are some times when you pay want to force links URL to open in a new window. It could be to open read and write permission, adverts or external links. IMP: that some believe that you should never force a href link to open in a new window or new tab as that decision should be left to the visitors.

Also Read This πŸ‘‰   Laravel 5.7 Delete Confirm Bootstrap jQuery Model

using jQuery Example

$(document).on('click', 'a', function(e){ 
    var url = $(this).attr('href');, '_blank');

PHP Open Hyperlinks in New tab window
PHP Open Hyperlinks in New tab window

using JavaScript(Use
var blog ='', '_blank');
if (blog) {
    //Browser detect has allowed it to be opened
} else {
    //Browser has blocked it
    alert('Please allow popups for this Blogspot');

Create hidden anchor tag

With jQuery library, you can create new anchor tag like:

$(document).ready(function() {
  $("#findproducts").click(function() {
      target: "_blank",
      href: ""

How to Open URL in New Tab using Jquery?

HTML a href target attribute supports simply as well as tiny way to open the linked URL in the new browser window or tab.

Example 1: jQuery attribute equals selectors

<!DOCTYPE html>
    <title>Jquery Open Link in New Tab on Click Example -</title>
    <script src=""></script>

<button class="btn">Click Me</button>
<script type="text/javascript">


This will instruct the browser Like as a Mozila, Chrome or more to leave the current Live active page as is and open the link in a new tab/window.

Also Read This πŸ‘‰   Live chat code in php with demo and free download : Updated 2021

Example 2: Target _blank alternative

<!DOCTYPE html>
    <title>Jquery Open Link in New Tab on Click Example -</title>

	<a href="" rel="noopener noreferrer" target="_blank">Click Me</a>

You need to use the _blank value in the target attribute to open the linked URL in a new tab or window.

<a href="" target="_blank" rel="noopener">Visit pakainfo</a>

using a Specify a class


<a href="/codelp" class="codelp">Read and Write Permmitions</a>

jquery code


    return false;


Free Live Chat for Any Issue

The bellow JavaScript simple source code will open in a new browser tab or window.'', '_blank');

I hope you get an idea about jquery open link in new window.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.