JSFiddle - React, Tailwind, and code Playground
by akash singh
HTML
<button onclick="check()">Go to Page 2</button>
JavaScript
function check(){
var online = window.navigator.onLine;
if (!online){
alert('You are not currently connected to the internet. Please try again later.');
} else{
alert("you are online");
}
}