JSFiddle - React, Tailwind, and code Playground
by wrxsti85
JavaScript
// This code will not work in JSFIDDLE!
// You will need to paste this into a test document,
// or into an active page's console to test.
// This code could also be extended to actively
// change the favicon to an alert symbol.
var toggle = false;
var title = document.title;
var start = setInterval(function() {
if (toggle) {
document.title = 'You have a message'
} else {
document.title = title;
}
toggle = !toggle;
}, 1000);
// Run clearInterval(start) to end the message loop