Try to disconnect from the internet to toggle between working online and offline
Example:
HTML
<!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>
Browsers Support of HTML ononline Event Attribute | Window Event Attributes |
Syntax of HTML ononline Event Attribute | Window Event Attributes |
Attribute Values of HTML ononline Event Attribute | Window Event Attributes |
Technical Details of HTML ononline Event Attribute | Window Event Attributes |
Example of HTML ononline Event Attribute | Window Event Attributes |
How to add a JavaScript when the browser changes from working offine to working online | Window Event Attributes |
What is HTML onafterprint Event Attribute | Window Event Attributes |
What is HTML onbeforeprint Event Attribute | Window Event Attributes |
What is HTML onbeforeunload Event Attribute | Window Event Attributes |
What is HTML onerror Event Attribute | Window Event Attributes |
What is HTML onhashchange Event Attribute | Window Event Attributes |
What is HTML onload Event Attribute | Window Event Attributes |
What is HTML onoffline Event Attribute | Window Event Attributes |
What is HTML ononline Event Attribute | Window Event Attributes |
What is HTML onpageshow Event Attribute | Window Event Attributes |
What is HTML onresize Event Attribute | Window Event Attributes |
Type: | Html |
Category: | Web Tutorial |
Sub Category: | Window Event Attributes |
Uploaded by: | Admin |