Altere o atributo OnClick com JavaScript

document.getElementById(id).setAttribute('onclick','myFunction()')
Powerful Peccary