[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 875
  • Last Modified:

simulate clicking on a link after 10 seconds

Hi,

Is there a way to simulate clicking on a link after 10 seconds in javascript?
0
zattz
Asked:
zattz
1 Solution
 
devicCommented:
<a id=myLink href="http://www.google.com">wait 10 sec</a>
<script>
setTimeout("document.getElementById('myLink').click()", 10000);
</script>
0
 
zattzAuthor Commented:
thanks
0
 
mrwhippleCommented:
This solution works great in Internet Explorer but in Firefox it throws the following JavaScript error
document.getElementById("myLink").click is not a function

Do you know a method that will work in both browsers?

Thanks
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now