---
title: Document.onoffline
slug: Web/API/Document/onoffline
tags:
  - API
  - DOM
  - NeedsContent
  - Property
  - Reference
---
{{APIRef("DOM")}}

The **`Document.onoffline`** event handler is called when an {{event("offline")}} is fired on the {{HtmlElement("body")}} element and bubbles up, when {{domxref("Navigator.onLine")}} property changes and becomes `false`.
