The notification should have a built-in close button, no?
HTML
<a href="#" onclick="return show()">Notify me!</a>
Js
<script>
var Notification = window.Notification || window.mozNotification || window.webkitNotification;
Notification.requestPermission(function (permission) {
});
function show() {
var instance = new Notification(
"Hey", {
body: "this is a message"
}
);
instance.onclick = function () {
};
instance.onerror = function () {
};
instance.onshow = function () {
};
instance.onclose = function () {
};
return false;
}
</script>
source
share