Skip to content
Related Articles

Related Articles

Improve Article
HTML | onoffline Event Attribute
  • Difficulty Level : Basic
  • Last Updated : 13 Oct, 2020

The onoffline event attribute works when the browser work in offline mode. It is supported by <body> tag only. It is an opposite of ononline event attribute.


<element onoffline = "script">

Attribute Value: The script event is run when onoffline attribute is called.



<!DOCTYPE html>
        <title>onoffline event attribute</title>
            h1 {
            body {
    <body onoffline = "gfg()">
        <h2>onoffline Event Attribute</h2>
            function gfg() {
                alert ("Browser working in offline mode");


onffline event

Supported Browsers: The browser supported by onoffline event attribute are listed below: 

  • Firefox 3.0
  • Internet Explorer 8.0


My Personal Notes arrow_drop_up
Recommended Articles
Page :