The ononline
attribute event is triggered
when the browser starts to work online.
The ononline
attribute is new in HTML5.
<element ononline="script or Javascript function name">
<body>
ononline |
No | 8.0 | Yes | No | No |
<!DOCTYPE html>
<html>
<body ononline="onFunction()" onoffline="offFunction()">
<!-- www .j av a 2 s. co m-->
<p>Open the File menu and click on "Work Offline" to
toggle between working online and offline.</p>
<script>
function onFunction() {
alert ("online.");
}
function offFunction() {
alert ("offline.");
}
</script>
</body>
</html>