How to check if online/offline
- Previous Page Remove Attribute
- Next Page Find Hidden Elements
Learn how to use JavaScript to detect whether the browser is online or offline.
Offline Detection
navigator
of the onLine
The property returns a boolean value to determine whether the browser is in online mode or offline mode:
Example
Check if the browser is online:
var x = "Is the browser online? " + navigator.onLine;
- Previous Page Remove Attribute
- Next Page Find Hidden Elements