Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript change favicon dynamicly

var link = document.querySelector("link[rel~='icon']");
if (!link) {
    link = document.createElement('link');
    link.rel = 'icon';
    document.getElementsByTagName('head')[0].appendChild(link);
}
link.href = 'https://stackoverflow.com/favicon.ico';
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #change #favicon #dynamicly
ADD COMMENT
Topic
Name
2+7 =