JSFiddle - React, Tailwind, and code Playground
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;
}
});
});