|
Definition and UsageThe onoffline attribute fires when the browser starts to work offline. Tip: The onoffline attribute is the opposite of the ononline attribute. Applies toThe onoffline attribute is part of the Event Attributes, and can be used on the following element:
|
<!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 onoffline attribute |
Type: | Develop |
Category: | Web Tutorial |
Sub Category: | HTML Attribute |
Uploaded by: | Admin |
Read Articlehttps://develop.horje.com/learn/1434/reference