HTML设置网站图标和标题
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>这里是title</title> <!--网页标题左侧显示--> <link rel="icon" href="xxx.ico" type="image/x-icon"> <!--收藏夹显示图标--> <link rel="shortcut icon" href="xxx.ico" type="image/x-icon"> </head> <body> </body> </html>
JS动态设置网站图标icon和标题title
const changeFavicon = link => { let $favicon = document.querySelector('link[rel="icon"]'); // If a <link rel="icon"> element already exists, // change its href to the given link. if ($favicon !== null) { $favicon.href =