JSFiddle - React, Tailwind, and code Playground

by Pradeep Shankar

HTML

<a href="javascript:void(0);" onclick="clickMe();">Click Me</a>

JavaScript

function clickMe() {

   //Do here whatsever you want
   var test = "test";
   alert(test);

   var link = "mylink/whatsever-query-string";

   /// You can also Use this if you want open link in self window
   // window.location.href = "mylink/whatsever-query-string"; 

   /// Use this if you want open link in new window
   window.open(link, "", 'width=500, height=600, toolbar=no,location=no, resizable=yes,scrollbars=yes, directories=no,status=no, titlebar=no');

 /// Use this if you want open link in new tab
 //  window.open(link, '_blank');


 }