|
Definition and UsageThe ononline attribute fires when the browser's connection status changes from offline to online. Tip: The ononline attribute is the opposite of the onoffline attribute. |
<element ononline="script">
| Value | Description |
|---|---|
| script | The script to be run on ononline |
| Supported HTML tags: | <body> |
|---|
Execute a JavaScript when the browser changes from working offine to working online.
<body ononline="myFunction()">
Try to disconnect from the internet to toggle between working online and offline
<!DOCTYPE html>
<html>
<body ononline="onFunction()" onoffline="offFunction()">
<p>Try to disconnect from the internet to toggle between working online and offline.</p>
<script>
function onFunction() {
alert ("Your browser is working online.");
}
function offFunction() {
alert ("Your browser is working offline.");
}
</script>
</body>
</html>
| html event attributes |
Type: | Develop |
Category: | Web Tutorial |
Sub Category: | HTML Window Event Attributes |
Uploaded by: | Admin |
Read Articlehttps://develop.horje.com/learn/1434/reference