Reputation: 111
How can I insert HTML tags inside the title and body of HTML5 notifications?
Upvotes: 11
Views: 3664
Reputation: 5875
You can easily insert HTML in both title and body:
var notification = new Notification('<title>title</title>',{body:'<b>bold</b> content'});
But there’s no point: it won’t render. In Firefox, it’ll look like this:
The spec says that each of them is just a DOMString
, and that means it’s just plain text.
If you care only about Chrome support, you might want to take a look at Rich Notifications. Otherwise, it seems we have to wait for some means to style desktop notifications.
Upvotes: 5