This seems deceptively simple.
How do you override the onclick event in the following HTML using JavaScript?
This can also be done without jQuery:
document.getElementById("sample").setAttribute('onclick','alert("done")');