check if browser is online code example Example: check if browser is online online = navigator.onLine // boolean