------------------ <button id="button">Change favicon</button> <script>function changeFavicon() {var link; link = document.createElement('link'); link.type = 'image/x-icon'; link.rel = 'shortcut icon'; link.href = 'https://ry3yr.github.io/OSTR/Diarykeepers_Homepage/favicon.ico'; document.getElementsByTagName('head')[0].appendChild(link);}; document.getElementById('button').addEventListener('click', function(event) { changeFavicon();}, false); document.body.addEventListener('online', function() { console.log('online')}, false); document.body.addEventListener('offline', function() { console.log('offline')}, false); </script> </plaintext>