var oTil=document.getElementById("title") var i=20; oTil.onclick=function(){ setInterval(function(){ this.style.left=300px; i++;},300 ) }