--- title: Notification.onclose slug: Web/API/notification/onclose tags: - Notification.onclose translation_of: Web/API/Notification/onclose ---

{{APIRef("Web Notifications")}}

Summary

{{domxref("Notification")}}  接口的 onclose属性指定一个事件侦听器来接收 {{event("close")}}事件。

当一个{{domxref("Notification")}}关闭时,会发生这些事件。

Syntax

Notification.onclose = function() { ... };

Specifications

This event handler is no longer listed in the Notifications API spec.

Browser compatibility

{{Page("/en-US/docs/Web/API/Notification","Browser compatibility")}}

See also