The onoffline
attribute event is triggered
when the browser starts to work offline.
The onoffline
attribute is new in HTML5.
<element onoffline="script or Javascript function name">
<body>
onoffline |
No | 8.0 | Yes | No | No |
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction() {<!--from w ww. jav a 2 s . c o m-->
alert("Page is offline");
}
</script>
</head>
<body onoffline="myFunction()">
<h1>Hello World!</h1>
</body>
</html>