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