Skip to content

Instantly share code, notes, and snippets.

@wwwisie
Created November 11, 2019 21:17
Show Gist options
  • Select an option

  • Save wwwisie/f1da7f9333444628210560b75b991d71 to your computer and use it in GitHub Desktop.

Select an option

Save wwwisie/f1da7f9333444628210560b75b991d71 to your computer and use it in GitHub Desktop.
Changing website favicon dynamically
(function() {
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href = '/favicon02.png';
document.getElementsByTagName('head')[0].appendChild(link);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment