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,544
  • 9
  • 23
  • 40

3 Answers3

8
document.getElementById('your_button').click();
Sascha Galley
  • 15,041
  • 5
  • 36
  • 51
2

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

Neil Knight
  • 45,890
  • 23
  • 126
  • 186
1
document.getElementById("theButton").onclick();

Here is an example fiddle.

James Allardice
  • 160,885
  • 21
  • 326
  • 309