ItSolutionStuff.com

JQuery Open Link in New Window Example

By Hardik Savani • July 20, 2023
jQuery

Here, i will tech you how to open link in new window on click event using jquery. we will do it using jquery open link in new window not tab. you can see a simple example of open url in new window using window.open() in jquery.

I written full example that will help you how to one new window like new chrome browser, firefox etc on click event. so let's see bellow example:

You can see bellow syntax for window.open().

Syntax:

window.open(URL, name, specs, replace)

Use:

window.open("https://www.itsolutionstuff.com", "mywindow", "status=1,toolbar=1");

You can see bellow full example so you will be understand how it works:

Example:

<!DOCTYPE html>

<html>

<head>

<title>Jquery Open Link in New Window Example - ItSolutionStuff.com</title>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

</head>

<body>

<button class="btn2">Click Me</button>

<script type="text/javascript">

$(".btn2").click(function(){

window.open("https://www.itsolutionstuff.com", "mywindow", "status=1,toolbar=1");

})

</script>

</body>

</html>

I hope it can help you...

Tags: jQuery
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

How to Remove Special Characters from a String in JQuery?

Read Now →

JQuery Moment Add Seconds to Datetime Example

Read Now →

JQuery Open Link in New Tab on Click Example

Read Now →

How to Allow Only 4 Digits Numbers in Textbox using JQuery?

Read Now →

JQuery Disable Submit Button on Click to Prevent Multiple Form Submits

Read Now →

JQuery Bootbox Modal Dialog Prompt Example

Read Now →

HTML Tags are not Allowed in Textbox Validation using JQuery

Read Now →

How to Remove All Whitespace from String in JQuery?

Read Now →

Preview an image before Upload using jQuery Example

Read Now →

Check and Uncheck All Checkbox using JQuery Example

Read Now →

How to Allow Only One Checkbox Checked at a Time in JQuery?

Read Now →

How to Convert Line Breaks to br in jQuery ?

Read Now →

How to Check Object is Empty or Not in JQuery?

Read Now →