JSFiddle - React, Tailwind, and code Playground
HTML
<button onclick="notify()">Notify</button>
JavaScript
function notify()
{
if (Notification.permission !== "granted") {
Notification.requestPermission();
}
else{
var notification = new Notification('hello', {
body: "Hey there!",
});
notification.onclick = function () {
window.open("http://google.com");
};
}
}