How do I use JavaScript to change the onclick value of a link?

Example link:
<a id="voteup" href="#" onclick="vote(0,1);">Vote Up</a>

Inside the function that's supposed to change the value, I've been trying to use something like:
document.getElementById("voteup").onclick = "vote("+itemID+",1);";

Needless to say, it's not working.

It works fine to change the href value though...
e.g.: document.getElementById("voteup").href = "vote.php?id="+itemID+"&amp;vote=1";