HTML onoffline Attribute

❮ HTML Attributes


<body ononline="onFunction()" onoffline="offFunction()">


The onoffline attribute fires when the user agent goes offline.

Found only on the <body> element.

Standard Syntax

<element onoffline="script">

Browser Support


Applies to:

The onoffline attribute can be used on the following element:

Element Attribute
<body> onoffline

Attribute Values

Value Description
script Specifies the script to be run on onoffline.
❮ HTML Attributes