$('#google').attr('onclick') + ""
However, Firebug shows that this returns a function 'onclick'. You can call the function later on using the following approach:
(new Function ($('#google').attr('onclick') + ';onclick();'))()
... or use a RegEx to strip the function
and get only the statements within it.