--- title: Notification.body slug: Web/API/Notification/body tags: - API - BODY - DOM - Notification - Notifications - Notifications API - Property - Reference - プロパティ - 通知 translation_of: Web/API/Notification/body ---
{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}
body は {{domxref("Notification")}} インターフェイスの読取専用プロパティで、 {{domxref("Notification.Notification","Notification()")}} コンストラクターの body オプションで指定された通知の本文文字列を返します。
var body = Notification.body;
{{domxref("DOMString")}} です。
function spawnNotification(theBody, theIcon, theTitle) {
var options = {
body: theBody,
icon: theIcon
}
var n = new Notification(theTitle, options);
console.log(n.body);
}
| 仕様書 | 状態 | 備考 |
|---|---|---|
| {{SpecName('Web Notifications','#dom-notification-body','body')}} | {{Spec2('Web Notifications')}} | Living standard |
{{Compat("api.Notification.body")}}