Prova così


Codice PHP:
document.getElementById("code").src 'captcha.php?' Math.floor(Math.random()*100);