By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 2,007 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

Sending Mouse Click to screen

100+
P: 196
Quick question does the javascript code below-

Expand|Select|Wrap|Line Numbers
  1. document.click()
Send a mouse click to where the mouse cursor is on the page or does it send it to somewhere else if so where??

Thats it, any help is appreciated
Sep 25 '08 #1
Share this Question
Share on Google+
5 Replies


rnd me
Expert 100+
P: 427
im not sure about that syntax, but firing generic click events sends the click to whatever element is focus, the mouse is not involved.

it's like pressing the spacebar when a button is highlighted.
Sep 25 '08 #2

100+
P: 196
i dont suppose there is way to aim where the click event points at???


Thanks for the reply
Sep 25 '08 #3

P: 93
What you want to do actually?
Tell us with example.No need of code just what you are thinking in words.
If on event you want to click on something then it is fine use focus method.

like this id.focus//where id is the element.
Sep 25 '08 #4

rnd me
Expert 100+
P: 427
if you are trying to actually simulate a mouse-click, no, javascript cannot do that.

you might be able to fake out a pre-bound click event with some hacking, but it would be easier to simply call it.

what exactly are you trying to accomplish?
Sep 25 '08 #5

100+
P: 196
Ok what im trying to achieve is actually is first to load a msg alert box directly where the mouse is at (have already achieved this), then after loading the msg box im trying to send a mouse click to msg box while the mouse is still over it.

The idea is trying to simulate mouse movements and events, and im trying to replicate the sending a mouse click to current position the mouse is hovering over.

Hope this aint to confusing lol, if this aint possible with javascript can you suggest another language.

Also id like to give the focus thing a go, do you perhaps know how it relates to sending mouse click events???

Thanks heaps
Sep 26 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.