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.
I
If you're using jQuery, you need to use the .trigger function, so it would be something like:
.trigger
element.trigger('click');
http://api.jquery.com/trigger/