Script to simulate mouse click on page load?
I'm wondering if anyone has heard of or come across a script that automates a mouse click on a certain part of the page when it loads. For example, I want the page to load and then automatically have the mouse click in the upper right corner of the screen, about 5px from the top and 5px from the right.
What are you trying to click? A button, radio button, ...?
I need it to click inside a certain div area to close a pop up...if that makes sense
Hmmm. I've never tried simulating a click on a div.
Maybe try
<div id="MyDiv></div>
document.getElementById('MyDiv').onclick();
or
document.getElementById('MyDiv').click();
but I would be surprised if either worked honestly.
or possible....
<div><a href="javascript :void();" id="MyLink"></a></div>
document.getElementById('MyLink').onclick();
or
document.getElementById('MyLink').click();
I'm almost certain you can simulate a link click, and since it is inside the div it may simulate clicking there as well.
Posting the code would make it lot easier to understand what you're trying to achieve.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks