I may be missing something, but I think Nile is missing the point here.
It really depends upon how the onclick event was assigned to the element in the first place. If it was hard coded, or if it was assigned sort of like so:
Code:
el.onclick = whatever
el being a reference to the element, whatever being a reference to the function or the function itself. If it was either of those two (really three if you want to get technical about it) ways, you may:
However, if the function assigned originally uses the 'this' keyword to refer to the element, then you must do something like so:
Code:
el.onclick.apply(el);
If the event was attached or added (addEventListener or attachEvent), another apprach will probably need to be taken. Similarly, if the event was added via some script library (like mootools, jQuery, Prototype, etc.), that library may or may not have its own way of doing what you want in this regard.
Bookmarks