SOURCE

console 命令行工具 X clear

                    
>
console
var odiv=document.getElementById('div1');
timer=null;

odiv.onclick=function(){

  setInterval(function(){
     
    odiv.style.left=odiv.offsetLeft+20+"px";
       
     

  },300)
  
 
 
}
<div id='div1'>div1</div>

#div1{width:100PX; height:100px; border:1px solid; position:absolute;top:100px;}