I was trying to figure out an easy way of changing the onclick value of a click-able element in a project I’m working on and found this solution — so incredibly simple, and it works in Safari, FF and IE…
document.getElementById(‘clickable-element-id’).onclick = function() {functionname(parameterlist);};

Tumblr Blog
Nerd.
Nice (MT) badge by the way.