Cambiar el atributo OnClick con JavaScrip

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