Back to Content

Notification: title property

files/en-us/web/api/notification/title/index.md

latest748 B
Original Source

{{APIRef("Web Notifications")}}{{securecontext_header}} {{AvailableInWorkers}}

The title read-only property of the {{domxref("Notification")}} interface indicates the title of the notification, as specified in the title parameter of the {{domxref("Notification.Notification","Notification()")}} constructor.

Value

A string.

Examples

js
function spawnNotification(theBody, theIcon, theTitle) {
  const options = {
    body: theBody,
    icon: theIcon,
  };

  const n = new Notification(theTitle, options);

  console.log(n.title);
}

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also