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