Click here to Skip to main content
14,982,671 members
Please Sign up or sign in to vote.
1.00/5 (1 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 10-Apr-21 15:17pm

1 solution

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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900