onoffline Event in JavaScript
onoffline Event in JavaScript
The onoffline event is used to triggger when the browser starts to work offline. It is similar to but opposite of ononline event. We can also find whether the broswer is online or offline by simply using navigator.onLine property.
Syntax:-
Its syntax is:- < element onoffline="my_script" > OR object.onoffline= function(){my_script} OR object.addEventListener("offline", my_script)