Flashing title notification in Javascript ES6.

1 month ago23k times

To flash title notification in Javascript ES6. we will use setInterval function.


let showalert = false;
const interval = setInterval(()=>{
  document.title = showalert ? 'Chat Application' : '(1) New Message';
},1000);

Add Answer

Add a codeAdd Code
Remove adsremove