Skip to content

Instantly share code, notes, and snippets.

@hwshim0810
Created November 6, 2017 06:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hwshim0810/d9516942f7e779246756f63de2126e54 to your computer and use it in GitHub Desktop.
Dynamic favicon using javascript
(function() {
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href = 'http://www.stackoverflow.com/favicon.ico';
document.getElementsByTagName('head')[0].appendChild(link);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment