Search w3schools.com:

SHARE THIS PAGE

Navigator onLine Property

Navigator Object Reference Navigator Object

Definition and Usage

The onLine property returns a Boolean value that specifies whether the system is in offline mode.

Syntax

navigator.onLine


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The onLine property is supported in all major browsers.


Example

Is the browser on line?

var x=navigator.onLine;

The result of x will be:


Try it yourself »


Navigator Object Reference Navigator Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]