--- title: Notification.onclose slug: Web/API/notification/onclose tags: - Notification.onclose translation_of: Web/API/Notification/onclose ---
{{APIRef("Web Notifications")}}
{{domxref("Notification")}} 接口的 onclose属性指定一个事件侦听器来接收 {{event("close")}}事件。
当一个{{domxref("Notification")}}关闭时,会发生这些事件。
Notification.onclose = function() { ... };
This event handler is no longer listed in the Notifications API spec.
{{Page("/en-US/docs/Web/API/Notification","Browser compatibility")}}