Fai così:
codice:<html> <head> <script type="text/javascript"> window.onload=function(){ document.getElementById("mioBottone").addEventListener("click",cambia); var timer1; var x=0; var y=0; var intervallo; function cambia(){ x=x+50; y=y+50; this.style.fontSize="40"; this.style.backgroundColor="cyan"; this.style.borderColor="blue"; this.style.color="red"; this.style.position="absolute"; this.style.top =y; this.style.left =x; document.getElementById("mioBottone").removeEventListener("click",cambia); intervallo=setInterval(sposta,1000); } function sposta(){ oggetto=document.getElementById("mioBottone"); x=x+50; y=y+50; oggetto.style.top =y; oggetto.style.left =x; } } </script> </head> <body> <input type="button" id="mioBottone" onclick="" value="cliccami"> </body> </html>


Rispondi quotando