JSFiddle - React, Tailwind, and code Playground

by Sudheer Nunna

JavaScript

window.onbeforeunload = function (e) {
// Your logic to prepare for 'Stay on this Page' goes here 
console.log("enterrr")
   return "Please click 'Stay on this Page' and we will give you candy";
};