<body> <script> // 设置网页图标 function seticon(url) { var link = document.querySelector("link[rel*='icon']") || document.createElement('link'); link.type = 'image/x-icon'; link.rel = 'shortcut icon'; link.href = url document.getElementsByTagName('head')[0].appendChild(link); } seticon("https://kernelsu.org/logo.png") </script> </body>
标签:网页,icon,JS,link,document,图标 From: https://www.cnblogs.com/kernelsu/p/17538512.html