6

Possible Duplicate:
How can I trigger a JavaScript event click

I am developing a website, i want to trigger a mouse click event to a button using java script. please can any one help me solve this problem.

thanks in advance

Community
  • 1
  • 1
Arun
  • 1,644
  • 9
  • 25
  • 41

3 Answers3

9
document.getElementById('your_button').click();
Sascha Galley
  • 15,711
  • 5
  • 37
  • 51
2

document.getElementById("id of button").onclick();

Neil Knight
  • 47,437
  • 25
  • 129
  • 188
1
document.getElementById("theButton").onclick();

Here is an example fiddle.

James Allardice
  • 164,175
  • 21
  • 332
  • 312