window-status/example.html

24 lines
492 B
HTML
Raw Normal View History

2023-12-04 17:16:46 +00:00
<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>