1

Possible Duplicate:
Simulate a click by using x,y coordinates? - Javascript

Would anyone know how to programmatically click in a div to a specific X,Y location? Using JQueryor plain javascript.

I'd like to click a button, which would simulate a click in a div via X,Y position.

Thanks!

Community
  • 1
  • 1
Peter
  • 11
  • 2

1 Answers1

0

This is how an image would work. Maybe it works for the div?

    $(document).ready(function() {
  $('img').click(function(e) {
    var offset = $(this).offset();
    alert(e.clientX - offset.left);
    alert(e.clientY - offset.top);
  });
});
locoboy
  • 38,002
  • 70
  • 184
  • 260