 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Execute a script when the browser starts to work offline in HTML?
When the web browser starts to work offline, the onoffline attribute triggers. You can try to run the following code to implement onoffline attribute −
Example
<!DOCTYPE html> <html>    <body ononline = "onlineFunc()" onoffline = "offlineFunc()">       <script>          function onlineFunc() {             alert ("Working online!");          }          function offlineFunc() {             alert ("Workinf offline!");          }       </script>       <p>Got o the web browser menu bar and click the File menu. Select "Work Offline" and toggle between online and offline.</p>    </body> </html>Advertisements
 