0

I have an anchor somewhere and need to call it's onclick event programmatically from Javascript. The site does not have JQuery.

The solution needs to be "cross-browser"

I tried:
document.getElementById('anchorID').onclick(); or document.getElementById('anchorID').click();

but nothing gets fired.

Thanks

SF Developer
  • 5,114
  • 14
  • 57
  • 105

1 Answers1

0

you can try raiseEvent, but I am not sure if it is cross-browser.

bart s
  • 5,018
  • 1
  • 33
  • 54