How can I insert HTML tags inside the title and body of HTML5 notifications?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With