Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Navigator onLine Property

Navigator onLine Property

Navigator Object Reference 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 Reference Navigator object