Is it possible to use given coordinates in order to simulate a click in JavaScript within a webpage?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can dispatch a click event, though this is not the same as a real click. For instance, it can’t be used to trick a cross-domain iframe document into thinking it was clicked.
All modern browsers support
document.elementFromPointandHTMLElement.prototype.click(), since at least IE 6, Firefox 5, any version of Chrome and probably any version of Safari you’re likely to care about. It will even follow links and submit forms: