Navigator onLine Property
Navigator object
Definition and Usage
The Navigator onLine property determines whether the browser is online, returning true if online, otherwise false.
Navigator onLine is a read-only property.
Syntax
navigator.onLine
Return Value
| Type |
| Boolean |
Browser support
All major browsers support the onLine property
| Chrome | IE | Edge | Firefox | Safari | Opera |
| Yes | Yes | Yes | Yes | Yes | Yes |
Example
Display all browser properties:
Example
let online
=
navigator.
onLine
;
Try it »
Navigator object