JSFiddle - React, Tailwind, and code Playground

by Mohammed Safeer

HTML

<button id="myButton">Open Google in New Tab</button>

JavaScript

$('#myButton').click(function () {
    var redirectWindow = window.open('http://google.com', '_blank');
    $.ajax({
        type: 'POST',
        url: '/echo/json/',
        success: function (data) {
            redirectWindow.location;
        }
    });
});