This is a piece of Javascript code I use on "Kwissle" to make the document title change temporarily. Other people might find it useful too.

Code looks like this:


var Title = (function() {
 var current_title = document.title
   , timer;

 return {
    showTemporarily: function (msg, msec) {
      msec = typeof(msec) !== 'undefined' ? msec : 3000;
      if (msec < 100) msec *= 1000;
      if (timer) {
        clearTimeout(timer);
      }
      document.title = msg;
      timer = setTimeout(function() {
        document.title = current_title;
      }, msec);
    }
 }
})();

Demo here

Your email will never ever be published.

Previous:
EmailInput HTML5 friendly for Django August 2, 2011 Django
Next:
Reciprocal lesson about gender perspectives September 2, 2011 Wondering
Related by category:
How to handle success and failure in @tanstack/react-query useQuery hook September 16, 2024 JavaScript
You don't need a context or state manager for TanStack Query in scattered React components January 2, 2026 JavaScript
An ideal pattern to combine React Router with TanStack Query November 18, 2024 JavaScript
How to SSG a Vite SPA April 26, 2025 JavaScript
Related by keyword:
Search GitHub issues by title, only May 31, 2024 GitHub
TornadoGists.org - launched and ready! April 6, 2011 Python, Tornado
The importance of the TITLE attribute April 23, 2008 Web development