Click here to Skip to main content
14,330,663 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi, i need a javascript for my website.

what i wanna do is that when smone loads my website, the script initiate the left mouse click automatically. that is on page load mouse click is stimulated.

dnt know if its possible or not. need help.
Thanx in advance

What I have tried:

I don't know if this can be done in Javascript, or requires any other language but i was wondering if this would be possible. please help.
Posted
Updated 7-Mar-17 23:19pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

It can be done in JS: See This Code Pen.
I used the onload Event, with jquery you can also use $(document).ready.

Added:
window.onload=function(){
  document.getElementById("linkid").click();
};
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100