Fake "click" to activate an onclick method

event-handling, javascript

Solution

If you're using JQuery you can do:

$('#elementid').click();

Problem

I have an element with an onclick method. I would like to activate that method (or: fake a click on this element) within another function. Is this possible?

Original source