window-status/example.html
2023-12-04 18:16:46 +01:00

24 lines
492 B
HTML

<ul>
<li>
<a href="https://google.com">This is a link</a>
</li>
<li>
<a href="https://duckduckgo.com">This is another link</a>
</li>
</ul>
<script src="window-status.js"></script>
<script>
var i = 0;
// Switch between "hello" and "Hello there :)" every 2 seconds - user must hover over a link and back for it to update
function update() {
if (i++ % 2 == 0) window.status = "hello";
else window.status = "Hello there :)";
}
update();
setInterval(update, 2000);
</script>