I have three webpage links, i want to switch between the pages after 30secs.
How do I do this with HTML/JS?
Use Case:
start with page abc.com
after 30secs, switch to page dfe.com
after 30secs, switch to page ghi.com
return to page abc.com and start from above again with the timer
Thank you
Your script on each page will look something like this:
<script>
window.onloadend = () => {
setTimeout(() => {
location.href = "page_to_next_page";
}, 30000); // 30000ms = 30s
}
</script>
Here, setTimeout is used to delay execution of the function inside of it by the duration specified in milliseconds.
You'll need to add this on each page but take note this will cause the site to redirect without any interaction from the user.