I\'m sure there are a million posts about this out there, but surprisingly I\'m having trouble finding something.
I have a simple script where I want to set the onC
Try:
document.getElementById("foo").onclick = function (){alert('foo');};