<body onoffline="offFunction()"> - Javascript DOM Event

Javascript examples for DOM Event:onoffline

Description

The onoffline event occurs when the browser starts to work offline.

Summary

Bubbles No
Cancelable No
Supported HTML tags: <body>

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body ononline="onFunction()" onoffline="offFunction()">

<script>
function onFunction() {//from w ww.j ava2  s  . c  om
    console.log("Your browser is working online.");
}

function offFunction() {
    console.log("Your browser is working offline.");
}
</script>

</body>
</html>

Related Tutorials