JSFiddle - React, Tailwind, and code Playground

by mayanksaxena19

HTML

<a id='noload' class="navbar-brand" href="http://www.google.com">no Click</a>

<a class="navbar-brand" href="http://www.google.com">Click</a>

JavaScript

submitFormOkay = false;
window.onbeforeunload = function () {
    console.log('onbeforeunload : ',submitFormOkay);
    if (!submitFormOkay) {`enter code here`
        return "Don't delay your Success. Get FREE career counselling session. Fill in the details below";
    } 
}

$('#noload').on('click',function(){
  	submitFormOkay = true;
});