1
2
function change_favicon(img) {
var favicon = document.querySelector('link[rel="shortcut icon"]');
Little function to change your site's favicon problematically to any png.
img variable must be a string, and img must be a png.
If you do not already have a link tag created the function will create one for you and put it in the head section of your site.
img variable must be a string, and img must be a png.
If you do not already have a link tag created the function will create one for you and put it in the head section of your site.
7 Responses
Write a comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.